[iyunv@ser ~]# service postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
[iyunv@ser ~]# chkconfig postfix on
[iyunv@ser ~]# chkconfig dovecot on
修改dovecot的配置文件
vim /etc/dovecot.conf
protocols = imap imaps pop3 pop3s(在后面启动dovecot时,说端口已经被使用,lsof -i tcp:端口,是pop3s占用了,如果出现这样的情况,把这里的pop3s去掉。)
listen = *
在iptables 里开放25,110,143端口
[iyunv@ser ~]# chkconfig saslauthd on
修改 /etc/sysconfig/saslauthd
[iyunv@ser ~]# vim /etc/sysconfig/saslauthd
# Directory in which to place saslauthd's listening socket, pid file, and so
# on. This directory must already exist.
SOCKETDIR=/var/run/saslauthd
# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=shadow
# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
# for the list of accepted flags.
FLAGS=
修改 /usr/lib/sasl2/smtpd.conf
[iyunv@ser ~]# vim /usr/lib64/sasl2/smtpd.conf
pwcheck_method: saslauthd
测试 saslauthd
[iyunv@ser ~]# service saslauthd restart
四.Dovecot 配置 Dovecot.conf
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u
service dovecot restart
然后在foxmail里就可以收发邮件了
添加邮件账号
useradd -g mail -s /sbin/nologin -d /home/MailUsers/redmine redmine
如果不建立用户目录则可以用以下命令
useradd -g mail -s /sbin/nologin -M redmine
passwd redmine