localhost 在发送的消息中

localhost 在发送的消息中

我有完全相同的问题。简而言之,我正在使用 mime::lite 发送管理员电子邮件,但它们似乎被标记为垃圾邮件,因为 localhost[127.0.0.1] 出现在标题中。

我的问题是如何摆脱电子邮件标题中对 localhost 和 127.0.0.1 的引用?

上面链接的问题的答案是安装 postfix,遗憾的是这已经安装在有问题的 Fedora 14 主机上,并且没有任何区别。

消息设置完成后,此行用于发送邮件:


MIME::Lite->send("sendmail", "/usr/lib/sendmail -t -oi -oem -froot\@mail.mydomain.com");

我尝试了 main.cf 中的各种配置,myhostname 设置为“mail.mydomain.com”。我尝试明确设置“myorigin = $myhostname”,但不出所料,由于这是默认设置,所以没有任何区别。

在以下所有示例和配置中,真实公共 IP 地址已被替换为 1.1.1.1,域名已被替换为 mydomain.com 和 mydomain1.com。

这是一个示例(已编辑)标题,其中有问题的部分以粗体显示:



Return-path: <[email protected]>

Received: from smtpin.myisp.com ([10.30.30.30])
by ms.myisp.com (ISP server details removed (built Aug 10 2011))
 with ESMTP id <[email protected]> for [email protected]; Thu,
 13 Oct 2011 12:49:08 +0000 (GMT)
Original-recipient: rfc822;[email protected]
Received: from mail.mydomain.com ([1.1.1.1.111])
 by smtpin.myisp.com (ISP server details removed (built Jan 31 2010))
 with ESMTP id <[email protected]> for [email protected]
 (ORCPT [email protected]); Thu, 13 Oct 2011 05:49:08 -0700 (PDT)
Received: from mail.mydomain.com (localhost [127.0.0.1])
    (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
    (No client certificate requested)   by mail.mydomain.com (Postfix)
 with ESMTPS id 6ZZ6Z6Z6666 for <[email protected]> Thu,
 13 Oct 2011 12:49:02 +0000 (UTC)
Received: (from root@localhost)  by mail.mydomain.com (8.14.4/8.14.4/Submit)

这是 postconf -n 的输出:


alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
bounce_queue_lifetime = 1
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
local_recipient_maps = 
mail_owner = postfix
mailbox_command = 
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_queue_lifetime = 1
mydestination = mail.mydomain01.com, mail.mydomain.com
myhostname = mail.mydomain.com
mynetworks = 127.0.0.0/8 [::1]/128
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.7.5/README_FILES
sample_directory = /usr/share/doc/postfix-2.7.5/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550

这是 /etc/hosts 的内容:

127.0.0.1     localhost localhost.localdomain
1.1.1.1   mail.mydomain.com main.mydomain1.com mail

我无法发布已标记为垃圾邮件的邮件的标头,因为发往我的真实地址的邮件不再被标记为垃圾邮件,因为我为来自我们服务器的电子邮件设置了“非垃圾邮件”标志。AOL 是(测试)目的地之一,无法使用 AOL Web 界面显示标头。发送到 gmail 地址的邮件根本无法到达,我猜服务器正在阻止投递。

我使用 http:进行了检查//www.mxtoolbox.com,结果变化无明显原因,但我们的服务器地址出现(然后再次消失)在两个列表中,因为“返回代码为 127.0.0.6”,这很奇怪,因为该特定的环回地址从未出现在我们的电子邮件中,除非 postfix 做了一些非常奇怪的事情,但这似乎不太可能。

如果需要任何其他配置数据,请告诉我。

答案1

这是您的邮件中唯一相关的一行:

Received: from mail.mydomain.com ([1.1.1.1.111])
 by smtpin.myisp.com (ISP server details removed (built Jan 31 2010))
 with ESMTP id <[email protected]> for [email protected]
 (ORCPT [email protected]); Thu, 13 Oct 2011 05:49:08 -0700 (PDT)

而且根本没有 localhost 的迹象。因此,您基于“localhost”问题而认为您的邮件被标记为垃圾邮件的假设是不正确的。一定是其他原因。

答案2

是否有比您提供的更多的标头?我之所以问这个问题,是因为如果一封电子邮件被 Spamassassin 之类的程序标记为垃圾邮件,它会在电子邮件中添加标头,说明它给这封电子邮件打了多少分,以及它“未通过”哪些测试。如果您有这些标头并且可以发布它们,这将更清楚地说明您的问题。我所说的标头通常在某处有垃圾邮件一词,例如

X-Spam-Status:
x-Spam-Score:

诸如此类的事情。

如果您在电子邮件中没有看到任何垃圾邮件标头,那么在我看来,您的电子邮件客户端本身就认定您的电子邮件是垃圾邮件。它如何确定这一点在很大程度上取决于您使用的电子邮件客户端。

相关内容