今日在配置zabbix邮件报警时,发生的一个惨淡事情。zabbix使用mailx发送邮件使用报错 553Envolope sender mismatch with login user..
大致的意思是:发件人和发件人邮箱不一样
但是我的配置信息都是对的如下
vi /etc/mail.rc
# For Linux and BSD, this should be set.
set bsdcompat
set form=zabbix****@sina.com smtp=smtp.sina.com
set smtp-auth-user=zabbix****@sina.com smtp-auth-password=******* smtp-auth=login#星号我自己加的。。
测试发送的时候发现,就是报 553Envolope sender mismatch with login user.. 图的话没了 ,查看发件箱发现from并不是我自己设定那个
下面这个是我还原场景的时候的另一个报错
[root@localhost ~]# echo "zzkfhaalfah" |mail -s "flsdflfjakljflds" Atlan_OPS@163.com
[root@localhost ~]# smtp-server: 451 Sender address format error.
"/root/dead.letter" 11/307
. . . message not sent.
[root@localhost ~]# tail dead.letter
From: root@localhost
To: Atlan_OPS@163.com
Subject: flsdflfjakljflds
Message-ID: <5b5597ea.uui2ql6zrBBDODeJ%root@localhost>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
zzkfhaalfah
查看日志发现from并不是我自己设定那个,即为/etc/mail.rc中设定的from并没有生效。于是采用mail命令的-r选项 指定邮件中from的值 -r的参数一定要跟SMTP验证的那个邮箱一样
[root@localhost ~]# echo "zzkfhaalfah" |mail -r zabbix****@sina.com -s "flsdflfjakljflds" Atlan_OPS@163.com
[root@localhost ~]#
在Atlan_OPS@163.com这个邮箱中查看
好吧顺便把451报错也解决了。。。