我正在尝试使用 Ubuntu 14.04(Postfix+ dovecot,主机名=idcmail.idc.healthcare)配置邮件服务器,但我的电子邮件被收录在收件人的垃圾邮件文件夹中。我知道这个问题有很多答案,但我几乎按照答案尝试了所有方法,但都无济于事。我已完成以下步骤
- 为域名设置了 PTR 记录
- DNS 中设置了 SPF 记录
- DKIM 已配置
- 通过 spamhaus 检查 IP 地址是否列入黑名单,但也是清楚的。
- Abuse 地址配置在 abuse.net
我在 Gmail 邮箱中收到的电子邮件标头显示我的 SPF 和 DKIM 已通过。以下是标头
Delivered-To: [email protected]
Received: by 10.79.72.1 with SMTP id v1csp1761228iva;
Sun, 13 Mar 2016 04:34:08 -0700 (PDT)
X-Received: by 10.98.34.205 with SMTP id p74mr21651199pfj.93.1457868848225;
Sun, 13 Mar 2016 04:34:08 -0700 (PDT)
Return-Path: <[email protected]>
Received: from idcmail.idc.healthcare (115-186-155-204.nayatel.pk. [115.186.155.204])
by mx.google.com with ESMTPS id l9si8897121pfb.158.2016.03.13.04.34.07
for <[email protected]>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Sun, 13 Mar 2016 04:34:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates 115.186.155.204 as permitted sender) client-ip=115.186.155.204;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of [email protected] designates 115.186.155.204 as permitted sender) [email protected];
dkim=pass [email protected]
Received: from [192.168.8.4] (unknown [39.47.91.89])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by idcmail.idc.healthcare (Postfix) with ESMTPSA id D3C1C80D36;
Sun, 13 Mar 2016 04:33:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=idc.healthcare;
s=dkim; t=1457868812;
bh=6imp6PpJMW+8Q5OtYGkLm8HP7ihBSc3AC9SAqXIvKYc=;
h=To:Cc:From:Subject:Date:From;
b=XaNuuKJ5/rdtcvDuTZKCaNUfluHOFeJgn7m2O6KfZ2gfEI7/ztVMd61b3Bvx3WUZO
zbLc8vt4UMaaWe5C4c5DqikNjqJ3VSmFqkzFdeS2pkv9e3F+n7LZ+wnINjAUHWFJsU
bfiq7KpVI9MWveOCAuTbsg4DLluxTBhNrYGvGykY=
To: [email protected]
Cc: [email protected], [email protected], [email protected],
[email protected], [email protected], [email protected]
From: bobby <[email protected]>
Subject: Email server
Message-ID: <[email protected]>
Date: Sun, 13 Mar 2016 16:33:28 +0500
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101
Thunderbird/38.6.0
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="------------010202010701020208060102"
This is a multi-part message in MIME format.
--------------010202010701020208060102
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Dig 命令返回以下详细信息
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> idc.healthcare
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37910
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;idc.healthcare. IN A
;; ANSWER SECTION:
idc.healthcare. 583 IN A 115.186.155.204
;; Query time: 2 msec
;; SERVER: 192.168.1.4#53(192.168.1.4)
;; WHEN: Mon Mar 21 09:40:41 PKT 2016
;; MSG SIZE rcvd: 59
MX 记录测试返回以下详细信息MX 记录测试器
我也尝试使用不同的免费服务测试我的电子邮件是否为垃圾邮件,但不知何故,我的电子邮件无法发送到这些服务提供的临时电子邮件地址,但是对于 gmail、yahoo、hotmail,它可以正常工作。向其中一项服务返回的消息是
Reporting-MTA: dns; idcmail.idc.healthcare
X-Postfix-Queue-ID: 2B41380CF5
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Sun, 13 Mar 2016 15:25:24 +0500 (PKT)
Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822;[email protected]
Action: failed
Status: 4.4.1
Diagnostic-Code: X-Postfix; connect to mail-tester.com[94.23.206.89]:25:
Connection timed out
在这里,我的服务器可以 ping 返回的电子邮件标头中提到的 IP,即 94.23.206.89。我当前的 MX 记录条目如下,我正在接收电子邮件
10 @ @ 1 Hour
30 smtp @ 1 Hour
0 smtp.idcmail @ 1 Hour
之前我尝试过使用以下 MX 记录来接收电子邮件
10 @ @ 1 Hour
30 @ smtp 1 Hour
0 @ smtp.idcmail 1 Hour
我肯定遗漏了什么。任何帮助都将不胜感激。
更新:配置 DKIM、SPF 和不在黑名单中的 IP 后,还可以做些什么来避免电子邮件进入垃圾邮件。这是一个测试服务器,没有向观众发送任何列表。
更新:我的反向 DNS 也正常,但为什么我无法发送到测试服务(如 mail-tester.com 等),而可以发送到 gmail、yahoo 或 hotmail(虽然是垃圾邮件)。日志中总是有超时消息,但我可以成功 ping 这些地址。
Mar 24 19:58:36 idcmail postfix/qmgr[987]: D059481247: from=<[email protected]>, size=755, nrcpt=1 (queue active)
Mar 24 19:59:06 idcmail postfix/smtp[1796]: connect to mail.isnotspam.com[74.208.174.205]:25: Connection timed out
Mar 24 19:59:36 idcmail postfix/smtp[1796]: connect to mx01.1and1.com[74.208.5.21]:25: Connection timed out
Mar 24 20:00:06 idcmail postfix/smtp[1796]: connect to mx00.1and1.com[74.208.5.3]:25: Connection timed out
Mar 24 20:00:06 idcmail postfix/smtp[1796]: D059481247: to=<[email protected]>, relay=none, delay=696, delays=606/0.02/90/0, dsn=4.4.1, status=deferred (connect to mx00.1and1.com[74.208.5.3]:25: Connection timed out)
Mar 24 20:03:36 idcmail postfix/qmgr[987]: 12D2A81258: from=<[email protected]>, size=755, nrcpt=1 (queue active)
Mar 24 20:04:06 idcmail postfix/smtp[1799]: connect to mail-tester.com[94.23.206.89]:25: Connection timed out
Mar 24 20:04:06 idcmail postfix/smtp[1799]: 12D2A81258: to=<[email protected]>, relay=none, delay=531, delays=501/0.02/30/0, dsn=4.4.1, status=deferred (connect to mail-tester.com[94.23.206.89]:25: Connection timed out)
答案1
您的 MX 反向 DNS 匹配错误。我通过 mxtoolbox 检查。我附上了屏幕截图。在此处输入图片描述