码迷,mamicode.com
首页 > 其他好文 > 详细

mialx配置qq邮箱发送邮件

时间:2017-01-08 09:54:52      阅读:353      评论:0      收藏:0      [点我收藏+]

标签:open   global   ssdb   xxxxxx   get   echo   tls   glob   crt   

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

set smtp-use-starttls
set from=xxxxxxxxx@qq.com
set smtp=smtp://smtp.qq.com:587
set smtp-auth-user=xxxxxxxxx@qq.com
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邮箱发送邮件

标签:open   global   ssdb   xxxxxx   get   echo   tls   glob   crt   

原文地址:http://www.cnblogs.com/hqqq/p/6261419.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!