mialx配置qq邮箱发送邮件

Posted hqqq

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mialx配置qq邮箱发送邮件相关的知识,希望对你有一定的参考价值。

#send mail use mailx(v12.0.4)
#edit configure file

set smtp-use-starttls
set [email protected]
set smtp=smtp://smtp.qq.com:587
set [email protected]
set smtp-auth-password=xxxxxxxxxxxx
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/

 

#can send,but cause a error that "Error in certificate: Peer‘s certificate issuer is not recognized."So change a method that don‘t know why,but it works:

mkdir /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
cd .certs
certutil -A -n "GeoTrust SSL CA - G3" -t "Pu,Pu,Pu"  -d ./ -i qq.crt

vim /etc/mail.rc
set nss-config-dir=/root/.certs/

 

最后,好像使用crond执行定时任务时,程序里都需要使用绝对路径。

以上是关于mialx配置qq邮箱发送邮件的主要内容,如果未能解决你的问题,请参考以下文章

解决jenkins邮件发送不出去

Linux向QQ邮箱发送邮件

Django 配置 qq 邮箱发送邮件

Python Django 配置QQ邮箱发送邮件

邮件发送 smtplib

python -- 简单配置发送邮件功能