mail命令没有正确设置发件人地址

在我的nagios,我已经设置电子邮件到goto [email protected],但是当电子邮件发送到这个电子邮件ID,它被发送到像[email protected]域。

为什么电子邮件转到[email protected](mon.myd.com是服务器的主机名)

这是邮件发送时后缀中的日志条目。

Oct 1 08:24:05 mon postfix/pickup[11811]: 73262140BA8: uid=1001 from=<[email protected]> Oct 1 08:24:05 mon postfix/cleanup[10125]: 73262140BA8: message-id=<[email protected]> Oct 1 08:24:05 mon postfix/qmgr[10872]: 73262140BA8: from=<[email protected]>, size=787, nrcpt=1 (queue active) Oct 1 08:24:05 mon postfix/smtp[10127]: 73262140BA8: to=<[email protected]>, relay=10.0.0.12[10.0.0.12]:25, delay=0.04, delays=0.02/0/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 78A99400E7) Oct 1 08:24:05 mon postfix/qmgr[10872]: 73262140BA8: removed 

输出grep电子邮件

 root@mon:~# grep email /etc/nagiosql/contacts.cfg host_notification_commands notify-host-by-email service_notification_commands notify-service-by-email email [email protected] 

邮件命令的输出:

grep mail /etc/nagiosql/commands.cfg

 command_name notify-host-by-email command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo:$HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -r [email protected] -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ $HOSTSTATE$ **" $CONTACTEMAIL$ command_name notify-service-by-email command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /usr/bin/mail -r [email protected] -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$