AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 776219
Accepted
Alex
Alex
Asked: 2016-05-12 12:15:12 +0800 CST2016-05-12 12:15:12 +0800 CST 2016-05-12 12:15:12 +0800 CST

yum-cron 邮件进入根目录而不是指定用户

  • 772

我有几台 RHEL 6 服务器,我已配置 yum-cron 在其上运行。我已将它们配置为将电子邮件输出发送到我的地址。问题是除了一台服务器之外的所有服务器仍在向 root 发送邮件。我确定我错过了一些简单的东西,但对于我的生活来说,弄清楚是什么。有什么建议么?

在下面的配置和日志中,ServerOne 正在将消息传递到正确的地址,而 ServerTwo 没有。

这是来自 ServerOne 的邮件日志:

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 的邮件日志:

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 的后缀 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 的后缀/规范:

[email protected]       [email protected]
@something.com           [email protected]
[email protected]    [email protected]
yum redhat rhel6
  • 1 1 个回答
  • 237 Views

1 个回答

  • Voted
  1. Best Answer
    Alex
    2016-09-22T07:49:02+08:002016-09-22T07:49:02+08:00

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

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

    在这种情况下,我必须安装 mailx yum 包。

    • 1

相关问题

  • 如何从 RHEL 5 迁移到 CentOS 5?

  • yum:两台服务器上的设置相同,结果不同

  • 用于维护 yum 存储库的工具

  • CentOS 的依赖挑战

  • RHEL 5.3 上可用的 yum 存储库

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve