我使用基于Nagios的OP5监控系统和Postfix。 如果我从OP5 Portal发送testing邮件,则会收到该邮件。 但是,如果一条消息发送导致问题,我会得到错误“客户端没有权限发送作为此发件人”
Maillog通过从OP5 Portal发送testing邮件
Mar 16 11:41:36 op5-system postfix/pickup[16667]: E6D2D80D33: uid=0 from=<root> Mar 16 11:41:36 op5-system postfix/cleanup[470]: E6D2D80D33: message-id=<[email protected]> Mar 16 11:41:36 op5-system postfix/qmgr[1613]: E6D2D80D33: from=<[email protected]>, size=379, nrcpt=1 (queue active) Mar 16 11:41:37 op5-system postfix/smtp[476]: E6D2D80D33: to=<root@op5-system>, relay=relayserver[192.168.1.2]:25, delay=0.78, delays=0.1/0.16/0.03/0.48, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=34904401] Queued mail for delivery) Mar 16 11:41:37 op5-system postfix/qmgr[1613]: E6D2D80D33: removed
Mailog通过发送邮件,从op5-system引起通知
Mar 17 13:13:18 op5-system postfix/pickup[30229]: 04FDB80C87: uid=299 from=<monitor> Mar 17 13:13:18 op5-system postfix/cleanup[31004]: 04FDB80C87: message-id= <[email protected]> Mar 17 13:13:18 op5-system postfix/qmgr[1610]: 04FDB80C87: from=<[email protected]>, size=1082, nrcpt=1 (queue active) Mar 17 13:13:18 op5-system postfix/smtp[31006]: 04FDB80C87: to=<root@op5-system>, relay=relayserver[192.168.1.2]:25, delay=0.06, delays=0.03/0.01/0.02/0.01, dsn=5.7.1, status=bounced (host relayserver[192.168.1.2] said: 550 5.7.1 Client does not have permissions to send as this sender (in reply to end of DATA command)) Mar 17 13:13:18 op5-system postfix/bounce[31007]: 04FDB80C87: sender non-delivery notification: 15B3880C8F Mar 17 13:13:18 op5-system postfix/qmgr[1610]: 04FDB80C87: removed
什么可能是一个可能的原因?
谢谢
交换的错误信息在这里很清楚
550 5.7.1客户端没有权限发送此发件人
这意味着交换只允许您的主机发送电子邮件与发件人[email protected] 。 不幸的是,通知邮件使用[email protected]作为发件人地址。
从OP5知识库中,有两个选项可以解决您的问题
使用后缀通用映射 。 您需要告诉postfix将发件人地址从[email protected]重写为[email protected]。
# Postfix main.cf smtp_generic_maps = hash:/etc/postfix/generic #/etc/postfix/generic [email protected] [email protected]
不要忘记后贴图文件
设置--from从通知命令中的参数 。 追加--from [email protected] 。 例如
command_name=host-notify command_line=$USER3$/notify/poller_notify_send.pl --from [email protected] --other-argument