停止sendmail服务
service sendmail stop
chkconfig sendmail off
安装DNS服务用于解析mail服务器
yum install bind bind-*
vim /var/named/chroot/etc/named.conf
options{
directory "var/named";
};
zone "zzp.com" {
type master;
file "zzp.com.zone";
};
cp /usr/share/doc/bind-
9.3.6/sample/var/named/named.zeone/var/named/chroot/var/named/zzp.com.zone
vim /var/named/chroot/var/named/zzp.com.zone
zzp.com
IN NS mail.zzp.com
mail
IN A 192.168.0.6
zzp.com.
IN MX 10
mail.zzp.com
service named restart
chkconfig named on
安装postfix
yum install postfix
service postfix start
chkconfig postfix on
配置postfix
vim /etc/postfix/main.cf
myhostname = mail.zzp.com
mydomain = zzp.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname,$mydomain
mynetworks = 192.168.0.0/24,127.0.0.0/8
relay_domains = $mydestination,zzp.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
service postfix restart
配置cyrus
vim /etc/sysconfig/saslauthd
MECH=shadow
/ect/init.d/saslauthd start
chkconfig saslauthd on
vim /etc/postfix/main.cf
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = ''
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,
reject_unauth_destination
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous
service postfix restart
chkconfig postfix on
perl -MMIME::Base64 -e 'print encode_base64("liuyb01")'
telnet mail.zzp.com 25
ehlo mail.zzp.com
auth login
quit
安装dovecot服务
yum install dovecot
vim /etc/dovecot.conf
protocols = pop3 pop3s
protocol pop3 {
listen = *:10100
}
service dovecot start
chkconfig dovecot on
安装cyrus-imapd
yum install cyrus-imapd cyrus-imapd-devel
vim /etc/postfix/main.cf
第456行去除#
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp
启动cyrus服务并设置为开机启动
/etc/init.d/cyrus-imapd start
chkconfig cyrus-imapd on
建立用户的邮箱
cyradm -u cyrus mail.zzp.com
cm user.xiaoz
cm user.xiaoz.Send
cm user.xiaoz.Trash
cm user.xiaoz.Drafts
exit
安装squirrelmail
yum install squirrelmail -y
配置squirrelmail
/usr/share/squirrelmail/config/conf.pl
重启httpd服务
service httpd restart
测试webmail
http://mail.zzp.com/webmail