设置主DNS配置文件. vim /var/named/chroot/etc/named.conf options { directory "/var/named"; }; zone "hanfangzhou.com" { type master; file "hanfangzhou.com.zone"; }; zone "laohu.com" { type master; file "laohu.com.zone"; };
配置2个mail服务器的区域文件
vim /var/named/chroot/var/named/hanfangzhou.com.zone @ IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum hanfangzhou.com. IN NS mail.hanfangzhou.com. mail IN A 192.168.18.48 hanfangzhou.com. IN MX 10 mail.hanfangzhou.com. vim /var/named/chroot/var/named/laohu.com.zone @ IN SOA @ root ( 42 ; serial (d. adams) 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum laoyu.com. IN NS mail.laohu.com. mail IN A 10.1.1.2 laoyu.com. IN MX 10 mail.laohu.com.
检查防火墙和SElinux是否关闭 验证 建立用户chaoyue [root@hanfangzhou ~]# useradd chaoyue [root@hanfangzhou ~]# passwd chaoyue Changing password for user chaoyue. New UNIX password: BAD PASSWORD: it is WAY too short Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@hanfangzhou ~]# testsaslauthd -u chaoyue -p '123' 0: OK "Success."
service postfix restart chkconfig postfix on 验证 perl -MMIME::Base64 -e 'print encode_base64(chaoyue);' Y2hhb3l1ZQ== perl -MMIME::Base64 -e 'print encode_base64(123);' MTIz [root@hanfangzhou ~]# telnet mail.hanfangzhou.com 25 Trying 192.168.18.48... Connected to mail.hanfangzhou.com (192.168.18.48). Escape character is '^]'. 220 mail.hanfangzhou.com ESMTP Postfix auth login 334 VXNlcm5hbWU6 Y2hhb3l1ZQ== 334 UGFzc3dvcmQ6 MTIz 235 2.0.0 Authentication successful
安装dovecot服务 yum install dovecot -y
修改配置文件 vim /etc/dovecot.conf protocols = pop3 pop3s protocol pop3 { listen = *:10100 # .. } service dovecot restart chkconfig dovecot on
安装cyrus
yum install cyrus-imapd cyrus-imapd-devel -y 修改postfix主配置文件 vim /etc/postfix/main.cf 修改 456行 去掉注释符 mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp service cyrus-imapd restart chkconfig cyrus-imapd on 修改cyrus密码并建立chaoyue用户邮箱 [root@hanfangzhou ~]# passwd cyrus Changing password for user cyrus. New UNIX password: BAD PASSWORD: it is WAY too short Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@hanfangzhou ~]# cyradm -u cyrus localhost IMAP Password: localhost.localdomain> cm user.chaoyue localhost.localdomain> cm user.chaoyue.Send localhost.localdomain> cm user.chaoyue.Trash localhost.localdomain> cm user.chaoyue.Drafts 安装 webmail squirrelmail yum install squirrelmail -y 设置 wenmail /usr/share/squirrelmail/config/conf.pl 重启HTTPD服务 同理设置MAIL服务器2(mail.laohu.com) 测试