https://www.cnblogs.com/wangbingbing/p/15419974.html
https://www.cnblogs.com/chris-cp/p/4843407.html
# 75行: 取消注释,设置hostname
myhostname = mail.lomu.me
# 83行: 取消注释,设置域名
mydomain = lomu.me
# 99行: 取消注释
myorigin = $mydomain
# 116行: 修改
inet_interfaces = all
# 119行: 推荐ipv4,如果支持ipv6,则可以为all
inet_protocols = ipv4
# 164行: 添加
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
# 264行: 取消注释,指定内网和本地的IP地址范围
mynetworks = 127.0.0.0/8, 10.0.0.0/24
# 419行: 取消注释,邮件保存目录
home_mailbox = Maildir/
# 571行: 添加
smtpd_banner = $myhostname ESMTP
# 添加到最后
# 规定邮件最大尺寸为10M
message_size_limit = 10485760
# 规定收件箱最大容量为1G
mailbox_size_limit = 1073741824
# SMTP认证
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
[root@mail ~]# vi /etc/dovecot/dovecot.conf
# 26行: 如果不使用IPv6,请修改为*
listen = *
[root@mail ~]# vi /etc/dovecot/conf.d/10-auth.conf
# 9行: 取消注释并修改
disable_plaintext_auth = no
# 97行: 添加
auth_mechanisms = plain login
[root@mail ~]# vi /etc/dovecot/conf.d/10-mail.conf
# 30行: 取消注释并添加
mail_location = maildir:~/Maildir
[root@mail ~]# vi /etc/dovecot/conf.d/10-master.conf
# 88-90行: 取消注释并添加
# Postfix smtp验证
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
[root@mail ~]# /etc/rc.d/init.d/dovecot start
Starting Dovecot Imap: [ OK ]
[root@mail ~]# chkconfig dovecot on
# 创建用户
useradd admin
#设置密码,会要求输入两次密码
passwd admin