I've a Postfix installation which works fine, I don't get any trouble with mails sent through a mail client (in my case, Thunderbird or RoundCube) when the To: address is a GMail account. However, I recently needed to use the PHPMailer tool to send some e-mails to some GMail
accounts, so I configured an account to be used via SASL authentication + TLS. I don't mean mass mailing, just 2-3 mails.
If I send the e-mail from the Thunderbird or RoundCube clients, the mail is not marked as spam. However, if I use PHPMailer, it always gets catalogued as spam. So I compared both headers and I just can't find the reason why the second is marked as spam while the first one is just ok.
The first header sent from a mail client which is not marked as spam:
Delivered-To:
[email protected]
Received: by 10.76.153.102 with SMTP id vf6csp230573oab;
Tue, 19 Aug 2014 11:08:19 -0700 (PDT)
X-Received: by 10.60.23.39 with SMTP id j7mr45544050oef.20.1408471699715;
Tue, 19 Aug 2014 11:08:19 -0700 (PDT)
Return-Path: <
[email protected]>
Received: from mail.mydomain.com (X.ip-92-222-X.eu. [92.222.X.X])
by mx.
google.com with ESMTPS id t5si27115082oej.10.2014.08.19.11.08.18
for <
[email protected]>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 19 Aug 2014 11:08:19 -0700 (PDT)
Received-SPF: pass (google.com: domain of
[email protected] designates 92.222.X.X as permitted sender) client-ip=92.222.X.X;
Authentication-Results: mx.
google.com;
spf=pass (google.com: domain of
[email protected] designates 92.222.X.X as permitted sender)
[email protected];
dkim=pass (test mode)
[email protected]
Received: by mail.mydomain.com (Postfix, from userid 111)
id D8F69120293D; Tue, 19 Aug 2014 19:08:17 +0100 (BST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mydomain.com; s=mail;
t=1408471697; bh=wKMX9gkQ7tCLv8ezrG5t4bICm/SSLQsNfTdZMToksWw=;
h=Date:From:To:Subject:From;
b=qRNcYVdmk+n3D1uuv0FInTx7/LzH2ojck9DgCmabFPvfke233lkojUOjezCUGx7iV
DL8EayZ28mzzzHpB7ETeMzop/5OS3BmvFtGKVD9gzc78cDIFXTDoRFAnkRWDR2IOxI
SOn5tiyODTFpkbDgJOndzQ6qL5K0S9ASNGCZrNL4=
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vpsX.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED,T_DKIM_INVALID
autolearn=ham autolearn_force=no version=3.4.0
Received: from [192.168.1.111] (unknown [77.231.X.X])
(using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
(No client certificate requested)
(Authenticated sender:
[email protected])
by mail.mydomain.com (Postfix) with ESMTPSA id 910341202624
for <
[email protected]>; Tue, 19 Aug 2014 19:08:17 +0100 (BST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mydomain.com; s=mail;
t=1408471697; bh=wKMX9gkQ7tCLv8ezrG5t4bICm/SSLQsNfTdZMToksWw=;
h=Date:From:To:Subject:From;
b=qRNcYVdmk+n3D1uuv0FInTx7/LzH2ojck9DgCmabFPvfke233lkojUOjezCUGx7iV
DL8EayZ28mzzzHpB7ETeMzop/5OS3BmvFtGKVD9gzc78cDIFXTDoRFAnkRWDR2IOxI
SOn5tiyODTFpkbDgJOndzQ6qL5K0S9ASNGCZrNL4=
Message-ID: <
[email protected]>
Date: Tue, 19 Aug 2014 19:08:24 +0100
From: My Name <
[email protected]>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version: 1.0
To: My other account <
[email protected]>
Subject: .
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
.
The second header sent from PHPMailer which is always marked as spam:
Delivered-To:
[email protected]
Received: by 10.76.153.102 with SMTP id vf6csp230832oab;
Tue, 19 Aug 2014 11:12:10 -0700 (PDT)
X-Received: by 10.60.121.67 with SMTP id li3mr44086252oeb.17.1408471930520;
Tue, 19 Aug 2014 11:12:10 -0700 (PDT)
Return-Path: <
[email protected]>
Received: from mail.mydomain.com (X.ip-92-222-X.eu. [92.222.X.X])
by mx.
google.com with ESMTPS id w8si27103806obn.30.2014.08.19.11.12.10
for <
[email protected]>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 19 Aug 2014 11:12:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of
[email protected] designates 92.222.X.X as permitted sender) client-ip=92.222.X.X;
Authentication-Results: mx.
google.com;
spf=pass (google.com: domain of
[email protected] designates 92.222.X.X as permitted sender)
[email protected];
dkim=pass (test mode)
[email protected]
Received: by mail.mydomain.com (Postfix, from userid 111)
id 1999D120293D; Tue, 19 Aug 2014 19:12:09 +0100 (BST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mydomain.com; s=mail;
t=1408471929; bh=N1JuHq1S+8GrjHcEK3xn8P1JS+ygEBv5LKe0BiXuVJo=;
h=Date:To:From:Reply-to:Subject:From;
b=K7tcPyArzSTY91VEw6mAAFtDurSGwgTLGkfUZdC5mqsg0g/1LzmZkgwdjj4NdJa6M
E2kDz3dwYN8FcZmbampJYFXxj4NQVtSnzjiWV40rpfOFqD2rXDGNIyB2QOjBZZ4WK3
7s4lyoJ/BrdQH4en8ctLVsDHed/KpHD4iGFEl67E=
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vpsX.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED,T_DKIM_INVALID
autolearn=ham autolearn_force=no version=3.4.0
Received: from rpi.mydomain.com (unknown [77.231.X.X])
(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
(No client certificate requested)
(Authenticated sender:
[email protected])
by mail.mydomain.com (Postfix) with ESMTPSA id B42AF1202624
for <
[email protected]>; Tue, 19 Aug 2014 19:12:08 +0100 (BST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mydomain.com; s=mail;
t=1408471928; bh=N1JuHq1S+8GrjHcEK3xn8P1JS+ygEBv5LKe0BiXuVJo=;
h=Date:To:From:Reply-to:Subject:From;
b=iXPM0tS36swudPTT4FOHHtPi5Ll6LbR60kNqCinZ8utcWoFE31SFTpoMEq5aCM5ux
wQMdFiN8c6vkjRGabmvqFTTIbwJsrToHo/4+Lt5HEBoQQE2Y3T+xGmnmGAHCS6stKB
yb7SVmtrIAsVtSMKA8VYIbmu2oYqV3afYt7g0OMQ=
Date: Tue, 19 Aug 2014 20:12:07 +0200
To:
[email protected]
From: Trying another account <
[email protected]>
Reply-to: Trying another account <
[email protected]>
Subject: .
Message-ID: <
[email protected]>
X-Priority: 3
X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"
.
I also tried:
Adding a User-Agent header to match the first one.
Removing the X-Mailer header.
No one of them made a difference. Is there some significant difference which is making the second e-mail to be marked as spam by Google?