系统环境:centos7.8 x86-64
安装 postfix dovecot
yum install -y postfix dovecot
编辑配置文件
vi /etc/postfix/main.cf
要修改的地方
75行 myhostname = mail.ydqh-tj.com.cn 这里换成自己的域名
83行 mydomain = ydqh-tj.com.cn 换成自己的域名
99行 myorigin = $mydomain
116行 inet_interfaces = all
119行 inet_protocols =ipv4
164行 mydestination =
m
y
h
o
s
t
n
a
m
e
,
l
o
c
a
l
h
o
s
t
.
myhostname, localhost.
myhostname,localhost.mydomain, localhost,$mydomain
264行 mynetworks = 168.100.189.0/28, 127.0.0.0/8
419行 home_mailbox = Maildir/
572行 smtpd_banner = $myhostname ESMTP $mail_name
在最后加上一下内容
message_size_limit = 10485760
mailbox_size_limit = 1073741824
# for SMTP-Auth
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
编辑配置文件
vi /etc/dovecot/dovecot.conf
需要修改的地方
24行 protocols = imap pop3 lmtp
30行 listen = *
编辑配置文件
vi /etc/dovecot/conf.d/10-auth.conf
需要修改的地方
10行 disable_plaintext_auth = no
100行 auth_mechanisms = plain login
编辑配置文件
vi /etc/dovecot/conf.d/10-master.conf
需要修改的地方
88-90行
unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix
group = postfix
}
编辑配置文件
vi /etc/dovecot/conf.d/10-ssl.conf
需要将第8行修改成 ssl = no
编辑配置文件
vi /etc/dovecot/conf.d/10-mail.conf
需要将第24行修改成 mail_location = maildir:~/Maildir
重启postfix dovecot
systemctl restart postfix || systemctl enable postfix
systemctl restart dovecot || systemctl enable dovecot
添加邮箱用户
useradd hello
passwd hello #这里设置密码要复杂一些至少8位
需要搭建邮件服务可以扫码交流