Gmail

PHP Mail() 到 Gmail = 垃圾郵件

  • November 26, 2012

最近,Gmail 開始將直接從我的伺服器發送的電子郵件(使用 php mail())標記為垃圾郵件,我在嘗試查找問題時遇到了問題。如果我從我的電子郵件客戶端發送同一封電子郵件的精確副本,它會進入 Gmail 收件箱。電子郵件是純文字,大約 7 行長,並包含純文字的 URL 連結。

由於從我的客戶發送的電子郵件很好,我認為內容不是問題。如果有人可以查看以下標題並向我提供一些建議,為什麼來自伺服器的電子郵件被標記為垃圾郵件,我們將不勝感激。

來自伺服器的電子郵件:


Delivered-To: mygmail@gmail.com
Received: by 10.49.98.228 with SMTP id el4csp101784qeb;
   Thu, 15 Nov 2012 14:58:52 -0800 (PST)
Received: by 10.60.27.166 with SMTP id u6mr2296595oeg.86.1353020331940;
   Thu, 15 Nov 2012 14:58:51 -0800 (PST)
Return-Path: >admin@mydomain.co.uk>
Received: from dom.mydomain.co.uk (dom.mydomain.co.uk. [xx.xx.xx.xx])
   by mx.google.com with ESMTPS id df4si17005013obc.50.2012.11.15.14.58.51
   (version=TLSv1/SSLv3 cipher=OTHER);
   Thu, 15 Nov 2012 14:58:51 -0800 (PST)
Received-SPF: pass (google.com: domain of admin@mydomain.co.uk designates xx.xx.xx.xx as permitted sender) client-ip=xx.xx.xx.xx;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of admin@mydomain.co.uk designates xx.xx.xx.xx as permitted sender) smtp.mail=admin@mydomain.co.uk; dkim=pass header.i=@mydomain.co.uk
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mydomain.co.uk; s=default;
   h=Date:Message-Id:Content-Type:Reply-to:From:Subject:To; bh=2RJ9jsEaGcdcgJ1HMJgQG8QNvWevySWXIFRDqdY7EAM=;
   b=mGebBVOkyUhv94ONL3EabXeTgVznsT1VAwPdVvpOGDdjBtN1FabnuFi8sWbf5KEg5BUJ/h8fQ+9/2nrj+jbtoVLvKXI6L53HOXPjl7atCX9e41GkrOTAPw5ZFp+1lDbZ;
Received: from grantw by dom.mydomain.co.uk with local (Exim 4.80)
   (envelope-from >admin@mydomain.co.uk>)
   id 1TZ8OZ-0008qC-Gy
   for mygmail@gmail.com; Thu, 15 Nov 2012 22:58:51 +0000
To: mygmail@gmail.com
Subject: Offer Accepted
X-PHP-Script: www.mydomain.co.uk/admin.php for xx.xx.xx.xx
From: My Name >admin@mydomain.co.uk>
Reply-to: admin@mydomain.co.uk
Content-Type: text/plain; charset=Windows-1251
Message-Id: >E1TZ8OZ-0008qC-Gy@dom.mydomain.co.uk>
Date: Thu, 15 Nov 2012 22:58:51 +0000
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - dom.mydomain.co.uk
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [500 500] / [47 12]
X-AntiAbuse: Sender Address Domain - mydomain.co.uk
X-Get-Message-Sender-Via: dom.mydomain.co.uk: authenticated_id: grantw/from_h

來自客戶的電子郵件:


Delivered-To: mygmail@gmail.com
Received: by 10.49.98.228 with SMTP id el4csp101495qeb;
       Thu, 15 Nov 2012 14:54:49 -0800 (PST)
Received: by 10.182.197.8 with SMTP id iq8mr2351185obc.66.1353020089244;
       Thu, 15 Nov 2012 14:54:49 -0800 (PST)
Return-Path: >admin@mydomain.co.uk>
Received: from dom.mydomain.co.uk (dom.mydomain.co.uk. [xx.xx.xx.xx])
       by mx.google.com with ESMTPS id ab5si17000486obc.44.2012.11.15.14.54.48
       (version=TLSv1/SSLv3 cipher=OTHER);
       Thu, 15 Nov 2012 14:54:49 -0800 (PST)
Received-SPF: pass (google.com: domain of admin@mydomain.co.uk designates xx.xx.xx.xx as permitted sender) client-ip=xx.xx.xx.xx;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of admin@mydomain.co.uk designates xx.xx.xx.xx as permitted sender) smtp.mail=admin@mydomain.co.uk; dkim=pass header.i=@mydomain.co.uk
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mydomain.co.uk; s=default;
   h=Content-Transfer-Encoding:Content-Type:Subject:To:MIME-Version:From:Date:Message-ID; bh=bKNjm+yTFZQ7HUjO3lKPp9HosUBfFxv9+oqV+NuIkdU=;
   b=j0T2XNBuENSFG85QWeRdJ2MUgW2BvGROBNL3zvjwOLoFeyHRU3B4M+lt6m1X+OLHfJJqcoR0+GS9p/TWn4jylKCF13xozAOc6ewZ3/4Xj/YUDXuHkzmCMiNxVcGETD7l;
Received: from w-27.cust-7941.ip.static.uno.uk.net ([xx.xx.xx.xx]:1450 helo=[127.0.0.1])
   by dom.mydomain.co.uk with esmtpa (Exim 4.80)
   (envelope-from >admin@mydomain.co.uk>)
   id 1TZ8Ke-0001XH-7p
   for mygmail@gmail.com; Thu, 15 Nov 2012 22:54:48 +0000
Message-ID: >50A572BA.9020401@mydomain.co.uk>
Date: Thu, 15 Nov 2012 22:54:50 +0000
From: My Name >admin@mydomain.co.uk>
User-Agent: Postbox 3.0.6 (Windows/20121031)
MIME-Version: 1.0
To: mygmail@gmail.com
Subject: Offer Accepted
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - dom.mydomain.co.uk
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - mydomain.co.uk
X-Get-Message-Sender-Via: dom.mydomain.co.uk: authenticated_id: admin@mydomain.co.uk

一些東西。

  1. 確保您的郵件伺服器 PTR 記錄設置為與您的 MX 記錄相同,與您的伺服器主機名不同。

  2. 您的 IP 地址似乎是 WebsiteWelcome/HostGator IP 地址。如果您還沒有,我會向他們尋求支持。當然,IP 可能是他們賣回給主機的舊 IP 地址,而您只是碰巧得到了它。

3)如果您精通tcpdump或wireshark,您可以嘗試在郵件發出時對其進行數據包擷取並從gmail伺服器獲取響應。這將比標題更有幫助。

  1. 請記住,Gmail 也會以不同的方式處理每個人的電子郵件,因為他們的垃圾郵件過濾器知道有些人認為是垃圾郵件,而另一些人則不知道 - 所以很可能您標記的內容與來自的內容相似您的伺服器是垃圾郵件(即使內容與您通過郵件客戶端發送的內容相同),因此 gmail 正在接受這一點。我想說嘗試使用不同的 gmail 電子郵件地址來測試該理論。

  2. X-Get-Message-Sender-Via: dom.domainbrokerage.co.uk: authenticated_id: grantw/from_h 這裡的問題是authenticated_id不是一個email地址。在 cpanel 中,為 cpanel 帳戶設置一個不是主電子郵件帳戶的專用電子郵件地址。

  3. X-PHP-Script: www.domainbrokerage.co.uk/admin.php for 95.172.231.27 Gmail 可能會看到這一點並據此阻止,但這只是一種預感。如果有可能刪除該標題,請這樣做。

希望其中一些幫助。

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