美文网首页zabbix
阿里云ECS使用465端口发送邮件

阿里云ECS使用465端口发送邮件

作者: 梦豪_079a | 来源:发表于2019-11-14 20:36 被阅读0次

    企业 zabbix server迁移到阿里云服务器,迁移过程中发现邮件告警功能无法使用。特记录下解决过程,

    备注:阿里云默认是关闭25端口的,使用25端口需要申请,要一天时间,等不了那么久,就使用465加密端口发送邮件,以下是实施过程。

    安装mailx

    yum-y install mailx

    腾讯企业邮箱配置

    vim /etc/mail.rcsetfrom=zabbix@xxxxx.comsetsmtp=smtps://smtp.exmail.qq.com:465setsmtp-auth-user=zabbix@xxxxx.comsetsmtp-auth-password=xxxxxxsetsmtp-auth=loginsetssl-verify=ignoresetnss-config-dir=/etc/pki/nssdb

    生成证书

    echo-n | openssl s_client -connect smtp.qq.com:465 | sed-ne'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'> /etc/pki/nssdb/qq.crt 

    certutil -A -n"GeoTrust SSL CA"-t"C,,"-d/etc/pki/nssdb/ -i /etc/pki/nssdb/qq.crt 

    certutil -A -n"GeoTrust Global CA"-t"C,,"-d/etc/pki/nssdb/ -i /etc/pki/nssdb/qq.crt certutil -L-d/etc/pki/nssdb/ 

    certutil -A -n"GeoTrust SSL CA - G3"-t"Pu,Pu,Pu"-d./ -i qq.crt 

    #认证同样,认证完会返回如下提示:Notice: Trust flag u issetautomaticallyifthe private key is present.

    测试发送邮件

    echo"test "|mail -v-s"test"menghao.shen@foxmail.com

    相关文章

      网友评论

        本文标题:阿里云ECS使用465端口发送邮件

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