Postfix 发送的邮件被退回或进入垃圾邮件

Postfix 发送的邮件被退回或进入垃圾邮件

我最近尝试设置邮件服务器,以便能够向使用 apache 托管的网站发送邮件。
起初我尝试使用 exim,但我收到了大量错误消息,并且我尝试发送的邮件被大多数目的地拒绝。我认为只有 Gmail 接受使用 exim 发送的邮件,但它们都被归类为垃圾邮件。

我最终决定改变并开始使用 Postfix,据说它更容易配置以满足我的需求。

我遵循基本配置步骤并尝试发送简单的邮件,但发生了同样的事情。

Jan  4 11:43:45 sd-79356 postfix/qmgr[29420]: 374A1A4D72: from=<[email protected]>, size=361, nrcpt=1 (queue active)
Jan  4 11:43:45 sd-79356 postfix/smtp[29427]: 374A1A4D72: to=<[email protected]>, relay=mx1.hotmail.com[65.54.188.94]:25, delay=0.67, delays=0.07/0/0.45/0.15, dsn=5.0.0, status=bounced (host mx1.hotmail.com$
Jan  4 11:43:45 sd-79356 postfix/smtp[29427]: 374A1A4D72: lost connection with mx1.hotmail.com[65.54.188.94] while sending RCPT TO
Jan  4 11:43:45 sd-79356 postfix/cleanup[29425]: DBBB1A4D75: message-id=<[email protected]>
Jan  4 11:43:45 sd-79356 postfix/bounce[29428]: 374A1A4D72: sender non-delivery notification: DBBB1A4D75

对于 Gmail 地址,邮件已发送,但被归为垃圾邮件。

我知道这是一个经常出现的问题,我想我已经阅读了 SO、SF 或其他论坛上的大部分帖子,但没有一个能解决我的问题。

读完这篇文章后,我尝试的最后一次配置更改是设置 TLS邮政,但不幸的是它并没有改变我的问题,同样的错误。

我忘了说我已经检查了十几次我的服务器是否被列入黑名单或被举报为垃圾邮件发送者,这可以解释这个问题,显然没有这样的问题,所以请不要告诉我我的问题可能是这样的(总有人在类似的问题中说要检查,所以如果你没有更好的建议,就不要浪费你的时间)。

最后一点,我的目标是能够为 Apache Virtualhosts 中托管的多个网站发送邮件,这意味着我将需要几个“发件人”外发地址,而且我不能直接在配置中写入外发地址名称。

这是我的配置/etc/postfix/main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

append_dot_mydomain = no

readme_directory = no

# What I added to use TLS support, which doesn't solve the problem
smtpd_use_tls=yes
smtpd_tls_security = may
smtpd_tls_key_file = /etc/postfix/tls/smtpd.key
smtpd_tls_cert_file = /etc/postfix/tls/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/tls/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtp_tls_security_level = may
smtp_tls_loglevel = 1
# till here

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = sd-xxxxx.dedibox.fr
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = xxx.xxx.xxx.xxx.online.net, sd-xxxxx.dedibox.fr, localhost.dedibox.fr, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only

我通过 Gmail 收到的邮件内容如下:

Received: from sd-xxxxx.dedibox.fr ([xxx.xxx.xxx.xxx])
    by mx.google.com with ESMTPS id 74si69449965wmm.7.2016.01.04.03.15.17
    for <[email protected]>
    (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
    Mon, 04 Jan 2016 03:15:18 -0800 (PST)
Received-SPF: neutral (google.com: xxx.xxx.xxx.xxx is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=xxx.xxx.xxx.xxx;
Authentication-Results: mx.google.com;
   spf=neutral (google.com: xxx.xxx.xxx.xxx is neither permitted nor denied by best guess record for domain of [email protected]) [email protected]
Received: by sd-xxxxx.dedibox.fr (Postfix, from userid 0)
id B5DA5A4D78; Mon,  4 Jan 2016 12:14:47 +0100 (CET)

答案1

  1. Gmail 解释了邮件被归类为垃圾邮件的原因。您检查过吗?
  2. 如果您的每个域名都有专用 IP,则需要检查其 A 和 PTR 记录是否同步。这可以大大增加通过垃圾邮件过滤器的机会。
  3. 尝试将 SPF 记录添加到您的域。

答案2

这引起了我的注意:

lost connection with mx1.hotmail.com[65.54.188.94] while sending RCPT TO

您确定您的 ISP 没有阻止传出 SMTP 吗?首先尝试telnet mx1.hotmail.com 25看看您是否能够连接。

相关内容