我有几个 CentOS 5.3 系统,所有这些系统上都有同样的问题。当我向“root”发送电子邮件(未指定域)时,电子邮件提供商会拒绝该电子邮件。有趣的是,我从邮件系统收到的电子邮件实际上是发送给同一个用户的,而我确实收到了该电子邮件。
这使得我的 cron 和 asterisk 发送的电子邮件首先被拒绝,然后我以邮件附件的形式从我的 mailerdeamon 中收到它们。
据我所知,这是因为“发件人”被归类为“不存在”。我不明白“firewall.basjes.nl”主机名(= 连接到我的电缆调制解调器的系统)如何进入电子邮件验证。
我的问题是:我必须更改哪些通用设置才能使其一次性适用于所有程序(而不仅仅是 cron 和 asterisk)?
我已将尽可能多的相关信息放在下面。
(我将所有 @ 替换为 #$# 以避免出现更多垃圾邮件)
笔记:
- 我的 ISP 是 Ziggo,必须通过其传出 smtp 中继进行中继。
- 我的邮件通过 Google Apps 托管。
- 我有一个本地 /root/.forward,其中包含 LogFilesHobby#$#basjes.nl
创建此电子邮件的命令:
# mail -s TEST root
asdfasdfa
.
Cc:
/var/log/maillog 的相关部分
Jun 22 09:54:51 hobby sendmail[3055]: n5M7sooT003055: from=root, size=35, class=0, nrcpts=1, msgid=<200906220754.n5M7sooT003055#$#hobby.basjes.nl>, relay=root#$#localhost
Jun 22 09:54:51 hobby sendmail[3056]: n5M7spZh003056: from=<root#$#hobby.basjes.nl>, size=317, class=0, nrcpts=1, msgid=<200906220754.n5M7sooT003055#$#hobby.basjes.nl>, proto=ESMTP, daemon=MTA, relay=hobby.basjes.nl [127.0.0.1]
Jun 22 09:54:51 hobby sendmail[3055]: n5M7sooT003055: to=root, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30035, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (n5M7spZh003056 Message accepted for delivery)
Jun 22 09:54:54 hobby sendmail[3057]: n5M7spZh003056: to=LogFilesHobby#$#basjes.nl, ctladdr=<root#$#hobby.basjes.nl> (0/0), delay=00:00:03, xdelay=00:00:03, mailer=relay, pri=30530, relay=smtp.ziggo.nl [212.54.34.9], dsn=5.0.0, stat=Service unavailable
Jun 22 09:54:54 hobby sendmail[3057]: n5M7spZh003056: n5M7ssZh003057: DSN: Service unavailable
Jun 22 09:54:54 hobby sendmail[3057]: n5M7ssZh003057: to=LogFilesHobby#$#basjes.nl, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31554, relay=smtp.ziggo.nl, dsn=2.0.0, stat=Sent (OK id=1MIeMf-0002Z6-UP)
我收到的回复邮件:
The original message was received at Mon, 22 Jun 2009 09:54:51 +0200
from hobby.basjes.nl [127.0.0.1]
----- The following addresses had permanent fatal errors -----
LogFilesHobby#$#basjes.nl
(reason: 550-Verification failed for <root#$#firewall.basjes.nl>)
(expanded from: <root#$#hobby.basjes.nl>)
----- Transcript of session follows -----
... while talking to smtp.ziggo.nl:
>>> MAIL From:<root#$#hobby.basjes.nl> SIZE=530
<<< 550-Verification failed for <root#$#firewall.basjes.nl>
<<< 550-Called: 209.85.219.47
<<< 550-Sent: RCPT TO:<root#$#firewall.basjes.nl>
<<< 550-Response: 550-5.1.1 The email account that you tried to reach does not exist. Please try
<<< 550-550-5.1.1 double-checking the recipient's email address for typos or
<<< 550-550-5.1.1 unnecessary spaces. Learn more at
<<< 550-550 5.1.1 http://mail.google.com/support/bin/answer.py?answer=6596 27si11493246ewy.99
<<< 550 B002 Sender e-mail address invalid / Afzender e-mail adres bestaat niet
554 5.0.0 Service unavailable
Final-Recipient: RFC822; root#$#hobby.basjes.nl
X-Actual-Recipient: RFC822; LogFilesHobby#$#basjes.nl
Action: failed
Status: 5.0.0
Diagnostic-Code: SMTP; 550-Verification failed for <root#$#firewall.basjes.nl>
Last-Attempt-Date: Mon, 22 Jun 2009 09:54:54 +0200
---------- Doorgestuurd bericht ----------
From: root <root#$#hobby.basjes.nl>
To: root#$#hobby.basjes.nl
Date: Mon, 22 Jun 2009 09:54:50 +0200
Subject: TEST
asdfasdfa
[root@hobby /etc/mail]# cat sendmail.mc | grep -v '^dnl '
divert(-1)dnl
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl
define(`SMART_HOST', `smtp.ziggo.nl')dnl
define(`confDEF_USER_ID', ``8:12'')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
define(`ALIAS_FILE', `/etc/aliases')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
define(`confAUTH_OPTIONS', `A')dnl
define(`confTO_IDENT', `0')dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl
FEATURE(`virtusertable', `hash -o /etc/mail/virtusertable.db')dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(`accept_unresolvable_domains')dnl
LOCAL_DOMAIN(`localhost.localdomain')dnl
MASQUERADE_AS(`basjes.nl')dnl
FEATURE(masquerade_envelope)dnl
FEATURE(masquerade_entire_domain)dnl
MASQUERADE_DOMAIN(localhost)dnl
MASQUERADE_DOMAIN(localhost.localdomain)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
答案1
我找到了问题的真正原因。
此设置使所有用户都映射到我指定的域
MASQUERADE_AS(`basjes.nl')dnl
除了指定
EXPOSED_USER(`root')dnl
因为所有 cron 作业等都在 root 下运行,所以它们都保留了完整的主机名,并经过电子邮件提供商的检查。他们可能进行这些检查是为了减少垃圾邮件负载。
解决方案:删除 EXPOSED_USER('root')dnl