2018.03.20
- 生成证书
mkdir -p /root/.certs/
echo -n | openssl s_client -connect smtp.exmail.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 ~/.certs/qq.crt
- 配置/etc/mail.rc
set from=xxx@qq.com
set smtp="smtps://smtp.qq.com:465"
set smtp-auth-user=xxx@qq.com
set smtp-auth-password=smtp的授权码
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/root/.certs/
- 发邮件
echo "正文"|mailx -a /home/work/test.jpg -s "主题" xxxx@qq.com
网友评论