本地机器,已经安装了postfix,可以发邮件,不能收邮件。
现在有需求,要在这个server上面收邮件。网上查找了一下,不少介绍,但是大部分都太复杂,居然要php,mysql等等。后来自己尝试了一下,实现收邮件即可。
步骤如下:
1. 安装
# yum install cyrus-sasl-md5 cyrus-sasl-plain cyrus-sasl
# yum install dovecot
2. 修改配置
=== postfix config file "/etc/postfix/main.cf"
myhostname = bjdbmon1.webex.com.cn
mydomain = webex.com.cn
inet_interfaces = all
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
=== "/etc/dovecot/dovecot.conf"
protocols = imap pop3 lmtp
disable_plaintext_auth = no
mail_location = mbox:~/mail:INBOX=/var/mail/%u
listen = *
=== "/etc/dovecot/conf.d/10-mail.conf"
mail_location = mbox:~/mail:INBOX=/var/mail/%u
=== "/etc/dovecot/conf.d/10-ssl.conf"
ssl = no
3. 重启/启动service
# service postfix restart
# service saslauthd start
# service dovecot start
4. 测试,收邮件