apt install libnss3-tools
mkdir .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 .certs
cd .certs
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
编辑配置信息 /etc/s-nail.rc
set from=xxxxxxxx@qq.com
set smtp=smtps://
smtp.qq.com:465set smtp-auth-user=xxxxxxx@qq.com
# 这个去开启 QQ 邮箱的 POP3 会有一串码
set smtp-auth-password=xxxxxxxx
set smtp-auth=login
set ssl-verify=ignore
# 上面生成的
cert.sh 文件路径
set nss-config-dir=/root/crontab/.certs
发送邮件
mailx -s "xx 主题" xxxx@gmail.com xxxx@163.com xxxx1@163.com < message.txt
这样应该是 OK,开放 465 端口后,我们用阿里云是可以发送邮件的