我有几个 CentOS 5.3 系统,在所有这些系统上都有同样的问题。当我向“root”(未指定域)发送电子邮件时,电子邮件被电子邮件提供商拒绝。有趣的是,我从邮件系统收到的电子邮件实际上是发送给同一用户的,而我确实收到了该电子邮件。
这使得来自我的 cron 和星号的电子邮件首先被拒绝,然后我将它们作为附件从我的 mailerdeamon 获取。
据我所知,这是因为“发件人”被归类为“不存在”。我不明白“firewall.basjes.nl”主机名(= 连接到我的电缆调制解调器的系统)如何进入电子邮件验证。
我的问题是:我必须更改什么通用设置才能使所有程序(不仅仅是 cron 和星号)一次性使用?
我在下面放置了尽可能多的相关信息。
(我用#$#替换了所有@以避免额外的垃圾邮件)
笔记:
- 我的 ISP 是 Ziggo,必须通过他们的传出 smtp 中继进行中继。
- 我的邮件是通过谷歌应用程序托管的。
- 我有一个包含 LogFilesHobby#$#basjes.nl 的本地 /root/.forward
创建此电子邮件的命令:
# 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
我找到了问题的真正原因。
此设置使所有用户都映射到我指定的域
除了指定的那些
因为所有 cron 作业等都在 root 下运行,所以它们都保留了完整的主机名,然后运行到电子邮件提供商的检查中。他们可能有这些检查来减少垃圾邮件的负载。
解决方案:删除 EXPOSED_USER(`root')dnl