配置Mailx/S-nail 使用QQ邮箱服务器

Posted by Sunday on 2018-05-22

不用自建的postfix,配置s-nail使用QQ邮箱服务器来发送邮件

安装

1
apt-get  install s-nail

配置

1
2
3
4
5
6
7
vim /etc/s-nail.rc 

set from="shaopengxx@qq.com"
set smtp="smtps://smtp.qq.com:465"
set smtp-auth-user="shaopengxx@qq.com"
set smtp-auth-password="lvyuzhxxxxbcab" #不是qq密码。而是授权码
set smtp-auth=login
1
yum install mailx
1
2
3
4
5
6
7
8
9
vim /etc/mail.rc

set from="shaopengxx@qq.com"
set smtp="smtps://smtp.qq.com:465"
set smtp-auth-user="shaopengxx@qq.com"
set smtp-auth-password="lvyuzhxxxxbcab" #不是qq密码。而是授权码
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb

测试

1
echo "this is test" | mail -s "test email" shaopengxx@qq.com