###修改配置文件 /etc/mail.rc
set from=XXXXXXXX@qq.com #你的qq邮箱
set smtp=smtps://smtp.qq.com:465 #邮箱所在服务器和端口地址
set smtp-auth-user=XXXXXXXXX@qq.com #你的qq邮箱
set smtp-auth-password=aaaaabbbbbccccc #这部分要划下重点,这里是配置授权码,【看下图配置授权码】,而不是邮箱的独立密码,否则发送邮件时报错(smtp-server: 535 Error: Ȩ¼http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256)
set smtp-auth=login #默认login即可
set ssl-verify=ignore #ssl认证方式
set nss-config-dir=/root/.certs #证书所在目录,这个可以自定义目录所在位置
###请求配置证书 下面的粘贴上去就管用
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
cd /root/.certs/
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ~/.certs/./ -i qq.crt
certutil -L -d /root/.certs