SMTP搭建

添加本地域名解析

sudo gedit /etc/hosts

127.0.0.1 mail .test.lab test

sudo gedit /etc/hostname

test

重启后用以下命令检测是否生效
hostname
hostname -f

安装postfix

sudo apt-get install postfix

sudo gedit /etc/postfix/main.cf

加上

mynetworks =127.0.0.0/8 192.168.5.0/24
inet_protocols = ipv4
home_mailbox =Maildir/

sudo service postfix restart


netstat -nlv
查看25端口是否开启

 

安装dovecot
sudo apt-get install dovecot-imapd dovecot-pop3d

sudo gedit /etc/dovecot/conf.d/10-auth.conf

disable_plaintest_auth = yes
auth_mechanisms =plain login


sudo gedit /etc/dovecot/conf.d/10-mail.conf

mail_location= maildir:/home/%u/Maildir


sudo gedit /etc/dovecot/conf.d/10-master.conf
设置port143    port110

 

修改权限

 unix_listener auth-userdb {
    mode = 0666
    user = postfix
    group = postfix
  }
posted @ 2020-06-24 18:19  f1veseven  阅读(257)  评论(0编辑  收藏  举报