yum-cron电子邮件转到根目录而不是指定的用户

我有几个RHEL 6服务器,我configuration了yum-cron来运行。 我已经configuration他们发送电子邮件输出到我的地址。 问题是,除了其中一台服务器之外,其他所有服务器仍然在向root发送邮件。 我确定我错过了一些简单的事情,但是我终其一生都在想什么。 有什么build议么?

在下面的configuration和日志中,ServerOne正在将消息传递到正确的地址,而ServerTwo则不是。

这里是来自ServerOne的maillog:

May 11 04:51:43 ServerOne postfix/pickup[31719]: 8093C29EBD5: uid=0 from=<root> May 11 04:51:43 ServerOne postfix/cleanup[53080]: 8093C29EBD5: message-id=<[email protected]> May 11 04:51:43 ServerOne postfix/qmgr[6134]: 8093C29EBD5: from=<[email protected]>, size=29582, nrcpt=1 (queue active) May 11 04:51:44 ServerOne postfix/smtp[53089]: 8093C29EBD5: to=<[email protected]>, relay=10.1.0.7[10.1.0.7]:25, delay=1.2, delays=0.29/0.01/0.01/0.9, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=6452520] Queued mail for delivery) May 11 04:51:44 ServerOne postfix/qmgr[6134]: 8093C29EBD5: removed 

请注意[email protected]的收件人地址。 现在,这里是来自ServerTwo的maillog:

 May 10 03:55:13 ServerTwo postfix/pickup[27828]: 0A93C29F4AA: uid=0 from=<root> May 10 03:55:13 ServerTwo postfix/cleanup[36376]: 0A93C29F4AA: message-id=<[email protected]> May 10 03:55:13 ServerTwo postfix/qmgr[5934]: 0A93C29F4AA: from=<[email protected]>, size=15519, nrcpt=1 (queue active) May 10 03:55:13 ServerTwo postfix/cleanup[36376]: 2EBA629F07B: message-id=<[email protected]> May 10 03:55:13 ServerTwo postfix/qmgr[5934]: 2EBA629F07B: from=<[email protected]>, size=15685, nrcpt=1 (queue active) May 10 03:55:13 ServerTwo postfix/local[36378]: 0A93C29F4AA: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.27, delays=0.19/0.06/0/0.02, dsn=2.0.0, status=sent (forwarded as 2EBA629F07B) May 10 03:55:13 ServerTwo postfix/qmgr[5934]: 0A93C29F4AA: removed May 10 03:55:13 ServerTwo postfix/smtp[36379]: 2EBA629F07B: to=<[email protected]>, orig_to=<root>, relay=10.1.0.7[10.1.0.7]:25, delay=0.27, delays=0.02/0.06/0.01/0.18, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=6432387] Queued mail for delivery) 

并记下[email protected]的收件人地址。

所以这里是我的ServerOne的yum-cron文件:

 YUM_PARAMETER="--security" CHECK_ONLY=no CHECK_FIRST=no DOWNLOAD_ONLY=no ERROR_LEVEL=1 DEBUG_LEVEL=1 RANDOMWAIT="1" MAILTO="[email protected]" SYSTEMNAME="Server One" CLEANDAY="0" SERVICE_WAITS=yes SERVICE_WAIT_TIME=300 

这里是ServerTwo的yum-cron:

 YUM_PARAMETER="--security" CHECK_ONLY=no CHECK_FIRST=no DOWNLOAD_ONLY=no ERROR_LEVEL=1 DEBUG_LEVEL=1 RANDOMWAIT="1" MAILTO="[email protected]" SYSTEMNAME="Server Two" CLEANDAY="0" SERVICE_WAITS=yes SERVICE_WAIT_TIME=300 

这里是ServerOne的postfix main.cf文件:

 queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix myhostname = serverone.something.com mydomain = something.com inet_interfaces = localhost inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost unknown_local_recipient_reject_code = 550 relayhost = 10.1.0.7 alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.6.6/samples readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sender_canonical_maps = hash:/etc/postfix/canonical 

这里是ServerTwo的main.cf:

 queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix mail_owner = postfix myhostname = servertwo.something.com mydomain = something.com inet_interfaces = localhost inet_protocols = all mydestination = $myhostname, localhost.$mydomain, localhost unknown_local_recipient_reject_code = 550 relayhost = 10.1.0.7 alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.6.6/samples sender_canonical_maps = hash:/etc/postfix/canonical readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES 

最后,来自ServerOne的postfix规范文件:

 [email protected] [email protected] @something.com [email protected] [email protected] [email protected] 

和ServerTwo的postfix / canonical:

 [email protected] [email protected] @something.com [email protected] [email protected] [email protected] 

发现问题。 从文件yum-cron:

如果设置MAILTO 并且邮件命令可用 ,则使用mail命令来传递yum输出

在这种情况下,我不得不安装mailx yum软件包。