美文网首页技术日常
linux16~mailx发邮件带附件

linux16~mailx发邮件带附件

作者: 摹喵居士 | 来源:发表于2018-03-20 15:36 被阅读235次

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 

相关文章

网友评论

    本文标题:linux16~mailx发邮件带附件

    本文链接:https://www.haomeiwen.com/subject/xrdbqftx.html