当前位置:Linux教程 - Linux综合 - 在rhas3.0上建立一个完整的邮件系统

在rhas3.0上建立一个完整的邮件系统

  rhas3.0 + qmail + mysql + smtp + vpopmail + igenus + qmailadmin 一、安装说明。 为了方便安装我在安装Redhat3.0时选了apache、PHP、mysql,注意mysql-devel开发包一定要装上, 二、安装UCspi-tcp-0.88 1.这是由于redhat3.0(包括redhat 9.0)的glibc的版本有问题,必须有下列软件及补丁才能编译 http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.a_record.patch http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.errno.patch http://qmail.te8.com/rpms/glibc-2.3.1/ucspi-tcp-0.88.nobase.patch 2.安装ucspi-tcp-0.88 #tar zxvf ucspi-tcp-0.88.tar.gz #cd ucspi-tcp-0.88 #patch -p1 < ../ucspi-tcp-0.88.a_record.patch #patch -p1 < ../ucspi-tcp-0.88.errno.patch #patch -p1 < ../ucspi-tcp-0.88.nobase.patch #make #make setup check 三、安装qmail 1.需要的软件及补丁 http://cr.yp.to/software/qmail-1.03.tar.gz http://www.ckdhr.com/ckd/qmail-103.patch http://www.qmail.org/qmailqueue-patch http://www.shupp.org/patches/qmail-maildir++.patch http://qmail.te8.com/rpms/glibc-2.3.1/qmail-1.03.errno.patch http://qmail.te8.com/rpms/glibc-2.3.1/qmail-1.03.qmail_local.patch http://members.elysium.pl/brush/qmail-smtp-auth/dist/qmail-smtpd-auth-0.31.tar.gz 2.建立目录 # mkdir /var/qmail # mkdir /var/qmail/alias 3.建组及用户 # groupadd nofiles # groupadd qmail # useradd alias -g nofiles -d /var/qmail/alias -s /nonexistent # useradd qmaild -g nofiles -d /var/qmail -s /nonexistent # useradd qmaill -g nofiles -d /var/qmail -s /nonexistent # useradd qmailp -g nofiles -d /var/qmail -s /nonexistent # useradd qmailq -g qmail -d /var/qmail -s /nonexistent # useradd qmailr -g qmail -d /var/qmail -s /nonexistent # useradd qmails -g qmail -d /var/qmail -s /nonexistent 4.打补丁及编绎安装qmail #tar zxvf qmail-1.03.tar.gz #tar zxvf qmail-smtpd-auth-0.31.tar.gz #cp qmail-smtpd-auth-0.31/base64.* qmail-1.03 #patch -d qmail-1.03 < qmail-smtpd-auth-0.31/auth.patch #cd qmail-1.03 #patch -p1 < ../qmail-103.patch #patch -p1 < ../qmailqueue-patch #patch -p1 < ../qmail-maildir++.patch #patch -p1 < ../qmail-1.03.errno.patch #patch -p1 < ../qmail-1.03.qmail_local.patch
[1] [2] [3] [4] 下一页 

#vi qmail-smtpd.c 将函数straynewline中的451改为553 #make setup check #./config-fast domain.com 5.添加别名用户 # touch /var/qmail/alias/.qmail-root # touch /var/qmail/alias/.qmail-postmaster # touch /var/qmail/alias/.qmail-mailer-daemon 6.如果存在postfix和sendmail,将它们停用。 #/etc/rc.d/init.d/sendmail stop #cp /var/qmail/bin/sendmail /usr/sbin/qmail.sendmail #rm -f /etc/alternatives/mta #ln -s /usr/sbin/qmail.sendmail /etc/alternatives/mta #rm -f /usr/lib/sendmail #rm -f /usr/sbin/sendmail #ln -s /var/qmail/bin/sendmail /usr/lib/sendmail #ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail #chmod 777 /usr/sbin/sendmail 四、安装vpopmail 1.下载vpopmail http://www.inter7.com/vpopmail/vpopmail-5.2.1.tar.gz 2.建立目录 #mkdir /home/vpopmail #mkdir /home/vpopmail/etc 3.添加用户和组 #groupadd vchkpw #useradd -g vchkpw vpopmail 4.添加mysql的vpopmail用户,用于操作vpopmail数据库 #mysqladmin -u root passWord **** 设置mysql的root密码。 #mysql -u root -p mysql>create database vpopmail; mysql>grant all on vpopmail.* to vpopmail@localhost identified by "密码"; 5.编译安装vpopmail #tar zxvf vpopmail-5.2.1.tar.gz #cd vpopmail-5.2.1 #vi vmysql.h =========================== vmysql.h ============================== #define MYSQL_UPDATE_SERVER "localhost" #define MYSQL_UPDATE_USER "vpopmail" #define MYSQL_UPDATE_PASSWD "****" (改成你设置的密码) #define MYSQL_READ_SERVER "localhost" #define MYSQL_READ_USER "vpopmail" #define MYSQL_READ_PASSWD "****" (改成你设置的密码) ========================================================== 6.创建tcp.smtp # vi /home/vpopmail/etc/tcp.smtp ==================== tcp.smtp ============================ 127.0.0.1:allow,RELAYCLIENT="" :allow ========================================================== #cd /home/vpopmail/etc #tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp 7.进行编译: # ./configure --prefix=/home/vpopmail --enable-mysql=y --enable-incdir=/usr/include/mysql --enable-libdir=/usr/lib/mysql --enable-default-domain=domain.com --enable-passwd=n --enable-defaultquota=52428800s (10485760:10MB,20971520:20MB,52428800s:50MB) --enable-tcprules-prog=/usr/local/bin/tcprules --enable-tcpserver-file=/home/vpopmail/etc/tcp.smtp --enable-vpopuser=vpopmail --enable-vpopgroup=vchkpw --enable-ip-alias-domains=n
上一页 [1] [2] [3] [4] 下一页 

# make # make install-strip 8.创建虚拟域 # cd /home/vpopmail/bin # /home/vpopmail/bin/vadddomain 域名 密码 # /home/vpopmail/bin/vadduser 用户名 密码 (用户名要带域名,如[email protected]) 删除创建域的命令是:./vdeldomain 域名 五、设置smtp-auth 1.修改vchkpw的属性 #chmod 4755 vchkpw #chown root.root vchkpw 2.下载安装cmd5checkpw wget http://members.elysium.pl/brush/cmd5checkpw/dist/cmd5checkpw-0.22.tar.gz #tar zxvf cmd5checkpw-0.22.tar.gz #cd cmd5checkpw-0.22 #make #make install 六、生成qmail的启动脚本 #cp /var/qmail/boot/home /var/qmail/rc # vi /var/qmail/rc //对rc文件进行修改,以决定投送方式: ================= rc ========================= #!/bin/sh # Using splogger to send the log through syslog. # Using dot-forward to support sendmail-style ~/.forward files. # Using qmail-local to deliver messages to ~/Mailbox by default. exec env - PATH="/var/qmail/bin:$PATH" qmail-start ./Maildir/ splogger qmail & ================== rc ========================== #vi /var/qmail/smtp =================== smtp ======================== #!/bin/sh QMAILDUID=qmaild NOFILESGID=nofiles /usr/local/bin/tcpserver -H -R -l 0 -t 1 -v -p -x /home/vpopmail/etc/tcp.smtp.cdb -u $QMAILDUID -g $NOFILESGID 0 smtp /var/qmail/bin/qmail-smtpd domain.com /home/vpopmail/bin/vchkpw /bin/true /bin/cmd5checkpw /bin/true 2>&1 /var/qmail/bin/splogger smtpd 3 & =================== smtp ============================ #vi /var/qmail/pop3 //编辑pop3服务的启动脚本 ====================== pop3 ========================= #!/bin/sh /usr/local/bin/tcpserver -H -R 0 pop3 /var/qmail/bin/qmail-popup domain.com /home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir & ======================= pop3============================== #chmod 755 /var/qmail/rc #chmod 755 /var/qmail/smtp #chmod 755 /var/qmail/pop3 七、运行qmail并测试 #/var/qmail/rc #/var/qmail/smtp # /var/qmail/pop3 #ps aux grep "qmail" 查看POP3和SMTP是否工作 # telnet 192.168.0.1 110 # telnet 192.168.0.1 25 注意在Outlook中设置邮件帐号时,用户名后要加上域名,如[email protected]。如果qmail出现问题,可查看mysql中的vpopmail数据库,/var/log下的my
上一页 [1] [2] [3] [4] 下一页 

(出处:http://www.sheup.com)


上一页 [1] [2] [3] [4] 

#chmod 755 /var/qmail/smtp #chmod 755 /var/qmail/pop3 七、运行qmail并测试 #/var/qmail/rc #/var/qmail/smtp # /var/qmail/pop3 #ps aux grep "qmail" 查看POP3和SMTP是否工作 # telnet 192.168.0.1 110 # telnet 192.168.0.1 25 注意在Outlook中设置邮件帐号时,用户名后要加上域名,如[email protected]。如果qmail出现问题,可查看mysql中的vpopmail数据库,/var/log下的my

(出处:http://www.sheup.com/)


上一页 [1] [2] [3] [4] [5]