Centos设置外发邮箱

   需要开放25端口

 netstat -tunlp |grep 25

 telnet smtp.qq.com 25

   请关闭防火墙!!!!

1.安装yum -y install mailx

systemctl enable --now postfix

systemctl status postfix.service

2.修改配置

vim /etc/mail.rc

set from=邮箱帐号
set smtp=smtp.qq.com
set smtp-auth-user=邮箱帐号
set smtp-auth-password=vedjhwysgfxacbebe (例如QQ邮箱:邮箱页面生成授权码,设置--->账户下拉POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务,点击生成授权码)

 开启以下服务:
POP3/SMTP服务               已开启 |  关闭
IMAP/SMTP服务                已开启 |  关闭
Exchange服务                    已开启 |  关闭
CardDAV/CalDAV服务        已开启 |  关闭
3. mail  -s  标题  邮箱地址
内容
编辑完成后 以   结束 
 
 
 
posted @ 2021-01-08 20:35  一动不动的咸鱼  阅读(95)  评论(0编辑  收藏  举报