您好,欢迎访问一九零五行业门户网

centos7怎么使用postfix发送邮件

1、配置hosts映射
2、安装postfix与mailx工具
[root@mail ~]# yum -y install postfix mailx[root@mail ~]# systemctl start postfix[root@mail ~]# systemctl enable postfix[root@mail ~]# netstat -anput | grep 25tcp 0 0 0.0.0.0:25 0.0.0.0:* listen 1820/master
3、定义postfix配置文件
[root@mail ~]# vim /etc/postfix/main.cfmyhostname = mail.mds.commydomain = mds.commyorigin = $mydomaininet_interfaces = allmydestination = $myhostname,$mydomain
4、申请163邮件证书
[root@mail ~]# mkdir /root/.certs[root@mail ~]# echo -n | openssl s_client -connect smtp.163.com:465 | sed -ne '/-begin certificate-/,/-end certificate-/p' > ~/.certs/163.crt[root@mail ~]# certutil -a -n "geotrust global ca" -t "c,," -d ~/.certs -i ~/.certs/163.crt[root@mail ~]# certutil -a -n "geotrust ssl ca" -t "c,," -d ~/.certs -i ~/.certs/163.crt[root@mail ~]# certutil -l -d /root/.certs[root@mail ~]# certutil -a -n "geotrust ssl ca - g3" -t "pu,pu,pu" -d ~/.certs/ -i ~/.certs/163.crt
5、借用163邮箱发送邮件
[root@mail ~]# vim /etc/mail.rcset ssl-verify="ignore"set smtp-auth="login"set from="mds302587@163.com"set smtp="smtps://smtp.163.com:465"set smtp-auth-user="mds302587@163.com"set smtp-auth-password="123456"set nss-config-dir="/root/.certs"
6、重启服务并发送测试邮件
[root@mail ~]# systemctl restart postfix[root@mail ~]# echo "this is a test mail" | mail -s '邮件测试' 452666750@qq.com
7、确认接收邮件
相关教程推荐:centos教程
以上就是centos7怎么使用postfix发送邮件的详细内容。
其它类似信息

推荐信息