在阿里云配置邮箱通知

参考文档

https://yq.aliyun.com/articles/644134

在linux使用mailx发送邮件
但是在阿里云的服务器是直接禁止使用25端口的

yum install -y mailx

配置 mailx

vim /etc/mail.rc 
set smtp=smtps://smtp.qq.com:465
set from=xxx@qq.com
set smtp-auth-user=xxx@qq.com
set smtp-auth-password=yourpassword
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/root/.certs

生成证书文件

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

发邮件测试

echo "241"|mail -s "214145" xxx@qq.com

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。