#创建证书
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
#信任证书
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu" -d ./ -i qq.crt
# 配置/etc/mail.rcE繁忙
set smtp="smtps://smtp.qq.com:465"
set smtp-auth=login
set smtp-auth-user="wangyun@94ip.com" #换成你的qq邮箱
set smtp-auth-password="ffsdfklkjsdksodihbvppsjg" # 换成你的qq邮箱第三方登录密码
set ssl-verify=ignore
#set nss-config-dir=/etc/pki/nssdb
set nss-config-dir=/root/.certs
说明:
#smtp-auth-password的密码是qq邮箱里面设置的第三方登录密码,不是你qq的密码,在qq邮箱设置界面配置
测试:
echo message3 | mail -v -r "wangyun@94ip.com" -s "hello world" wangyun@94ip.com
注意:一定要带-r参数,生产上去掉-v参数
发表评论