#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执行定时任务时,程序里都需要使用绝对路径。