xmail

Eg挨蒙—zabbix4.2.8配置邮件告警

孤者浪人 提交于 2020-08-09 07:59:24
场景介绍: 因为阿里云封禁了25端口,导致zabbix发送邮件失败的问题,这里采用163邮箱的TSL加密协议,465端口进行发送邮件。作者已踩过诸多大坑,接下来将把正确的过程编写出来。 一、启用163邮箱授权码 #这里之前是关闭的,点击打开,开启后保存好授权码。 二、添加zabbix邮件发送 1、将postfix关闭 [root@localhost ~]# systemctl stop postfix.service [root@localhost ~]# systemctl disable postfix.service 安装mailx [root@localhost ~]# yum -y install mailx 更改mail.rc配置文件 [root@localhost ~]# vim /etc/mail.rc 在最后一行加入 set smtp="smtps://smtp.163.com:465" set from="你的账户@163.com" set smtp-auth=login set smtp-auth-user="你的账户@163.com" set smtp-auth-password="你的授权码" set ssl-verify=ignore set nss-config-dir=/home/zabbix/.certs 注意:这里的配置顺序千万不能错