1.配置/etc/mail.rc
set from=xxx@host.cn #发送方邮件地址
set smtp=smtps://smtp.exmail.qq.com:465 #邮件服务器
set smtp-auth=login #验证方式/登录验证
set smtp-auth-user="xxx@hosts.cn" #发送方用户权限验证
set smtp-auth-password="xxxxxxxxxx" #发送方验证密钥
set ssl-verify=ignore
set nss-config-dir=/root/.certs
#set nss-config-dir=/etc/pki/nssdb
2.生成nss-config-dir配置
mkdir -p /root/.certs/
echo -n | openssl s_client -connect smtp.qq.com:465 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ~/.certs/qq.crt
certutil -A -n "GeoTrust SSL CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -A -n "GeoTrust Global CA" -t "C,," -d ~/.certs -i ~/.certs/qq.crt
certutil -L -d /root/.certs
3.进入证书文件夹
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
4.搞定,可以发邮件了
可参考文章:https://blog.youkuaiyun.com/djhsun/article/details/78731683