Email

當 hostname.domain.nl 位於“發件人:”電子郵件地址中時,電子郵件被拒絕

  • June 26, 2009

我有幾個 CentOS 5.3 系統,在所有這些系統上都有同樣的問題。當我向“root”(未指定域)發送電子郵件時,電子郵件被電子郵件提供商拒絕。有趣的是,我從郵件系統收到的電子郵件實際上是發送給同一使用者的,而我確實收到了該電子郵件。

這使得來自我的 cron 和星號的電子郵件首先被拒絕,然後我將它們作為附件從我的 mailerdeamon 獲取。

據我所知,這是因為“發件人”被歸類為“不存在”。我不明白“firewall.basjes.nl”主機名(= 連接到我的電纜調製解調器的系統)如何進入電子郵件驗證。

我的問題是:我必須更改什麼通用設置才能使所有程序(不僅僅是 cron 和星號)一次性使用?

我在下面放置了盡可能多的相關資訊。

(我用#$#替換了所有@以避免額外的垃圾郵件)

筆記:

  • 我的 ISP 是 Ziggo,必須通過他們的傳出 smtp 中繼進行中繼。
  • 我的郵件是通過Google應用程序託管的。
  • 我有一個包含 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 $$# 貓發送郵件.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

我找到了問題的真正原因。

此設置使所有使用者都映射到我指定的域

MASQUERADE_AS(`basjes.nl')dnl

除了指定的那些

EXPOSED_USER(`root')dnl

因為所有 cron 作業等都在 root 下執行,所以它們都保留了完整的主機名,然後執行到電子郵件提供商的檢查中。他們可能有這些檢查來減少垃圾郵件的負載。

解決方案:刪除 EXPOSED_USER(`root’)dnl

引用自:https://serverfault.com/questions/29612