首页 > 运维 > CentOS > 正文

centos7怎么使用postfix发送邮件

王林
发布: 2020-04-02 10:49:06
原创
3431人浏览过

centos7怎么使用postfix发送邮件

1、配置hosts映射

53114a30dbccf873f2b35ecb419d3cd.png

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 25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      1820/master
登录后复制

3、定义Postfix配置文件

[root@mail ~]# vim /etc/postfix/main.cf
myhostname = mail.mds.com
mydomain = mds.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $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.rc
set 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发送邮件的详细内容,更多请关注php中文网其它相关文章!

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号