DKIM SPF passes but mail goes to Spam Received: (from abc#localhost) [closed] - spam

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I am facing an issue with the DKIM setup. We are sending newsletters which are going to spam in gmail. The dkim & spf passes. Even the reverse dns is setup properly. Below is a copy of mail headers that I see in gmail.
Delivered-To: xyz#gmail.com
Received: by 10.112.29.116 with SMTP id j20csp27976lbh;
Tue, 2 Jul 2013 10:28:18 -0700 (PDT)
X-Received: by 10.50.11.103 with SMTP id p7mr22069045igb.24.1372786097413;
Tue, 02 Jul 2013 10:28:17 -0700 (PDT)
Return-Path:
Received: from mydomain.com (newsletter.mydomain.com. [108.171.163.8])
by mx.google.com with ESMTP id gu10si1702677icb.68.2013.07.02.10.28.16
for ;
Tue, 02 Jul 2013 10:28:17 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of abc#mydomain.com designates 108.171.163.8 as permitted sender) client-ip=108.171.163.8;
Authentication-Results: mx.google.com;
spf=pass (google.com: best guess record for domain of abc#mydomain.com designates 108.171.163.8 as permitted sender)
smtp.mail=abc#mydomain.com; dkim=pass header.i=#mydomain.com
Received: from mydomain.com (mydomain.com [127.0.0.1])
by mydomain.com (Postfix) with ESMTP id 4A47318970;
Tue, 2 Jul 2013 17:30:38 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mydomain.com;
s=default; t=1372786238;
bh=s49+JPD0rpGLWWNhx0l6oMGPXzMHX4Adnh2xr6Q+4Iw=;
h=Date:Message-Id:To:Subject:MIME-Version:From:Content-Type;
b=NCmIyPQwp48nXJBpYdaVcmopJgOoLZ7H9KRcJ/o/HW2ZEZLRXreVwHRPWFI+s0h70
iVZPKVemBlAXtaL9T1hQOC61YVS//k3CEmUR732Axnz96dnJFbe5YtiD+mJN7dRZeL
Z7sf44NVi2E5EMWV7bi/RU7py0LNNo9Lp6KfzZLA=
Received: (from abc#localhost)
by mydomain.com (8.14.5/8.14.5/Submit) id r62HUcoh028894;
Tue, 2 Jul 2013 17:30:38 GMT
Date: Tue, 2 Jul 2013 17:30:38 GMT
Message-Id: <201307021730.r62HUcoh028894#mydomain.com>
To: xyz#gmail.com
Subject: mydomain | Subject Details
MIME-Version: 1.0
From: mydomain
Content-Type: multipart/alternative;boundary=np51d30e1a36dd3
I Think so the Received: (from abc#localhost) is causing the issue.
What I need to know how to resolve it. Instead of localhost it should use mydomain.com This is my first time setting up such kind of server.

This may be the problem with the envelope sender and from address because,an email has two addresses associated with sending it: the envelope sender, and the From: address. The envelope sender is where computers should respond (in the case of bounce messages or errors); the From: address is where people should respond. In most cases, the envelope sender and the From: address match.Some case the Gmail put the mails which the 2 sender field did not match. You may try with the same.

Related

Is it possible to get email header from SENT item with OWA rest-api?

According to this question Is it possible to retrieve the RFC 2822 (or any) headers from an email with the Outlook/Office 365 REST API?
by doing
GET https://outlook.office.com/api/beta/me/mailfolders/inbox/messages$select=InternetMessageHeaders
But I can get the header only for inbox items, I need to retrieve the header for the sent items as well!
You can get it using the $value parameter to get the MIME type of the message and read the entire header!
From Example 4 - Get message
GET https://graph.microsoft.com/v1.0/me/messages/4aade2547798441eab5188a7a2436bc1/$value
Response
HTTP/1.1 200 OK
Content-type: text/plain
Received: from contoso.com (10.194.241.197) by
contoso.com (10.194.241.197) with Microsoft
SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1374.0 via Mailbox
Transport; Mon, 4 Sep 2017 03:00:08 -0700
Received: from contoso.com (10.194.241.197) by
contoso.com (10.194.241.197) with Microsoft
SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1374.0; Mon, 4 Sep
2017 03:00:07 -0700
Received: from contoso.com
(fe80::5bf:5059:4ca0:5017) by contoso.com
(fe80::5bf:5059:4ca0:5017%12) with mapi id 15.01.1374.000; Mon, 4 Sep 2017
03:00:01 -0700
From: Administrator <admin#contoso.com>
To: Administrator <admin#contoso.com>
Subject: This email has attachment.
Thread-Topic: This email has attachment.
Thread-Index: AQHTJWSHSywMzSz8o0OJud48nG50GQ==
Date: Mon, 4 Sep 2017 10:00:00 +0000
Message-ID:
                <4aade2547798441eab5188a7a2436bc1#contoso.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Exchange-Organization-AuthAs: Internal
X-MS-Exchange-Organization-AuthMechanism: 04
X-MS-Exchange-Organization-AuthSource:
                contoso.com
X-MS-Has-Attach: yes
X-MS-Exchange-Organization-Network-Message-Id:
                0ffdb402-ec03-42c8-5d32-08d4f37bb517
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
MIME-Version: 1.0
The email headers are created by the email servers, these details can
include who sent the message, the software that was used to compose
it, and the email servers that it passed through on its way to the
recipient. Hence you are not able to view the header information for
the sent messages.

Email not delivering to hotmail, and extra headers [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm setting up an e-mail server and had a hard time trying to modify the headers, and getting it to e-mail hotmail.
Here are the complete headers from mail-tester.com:
Received: by mail-tester.com (Postfix, from userid 500)
id EBF72A56C8; Tue, 20 Mar 2018 22:12:50 +0100 (CET)
Authentication-Results: mail-tester.com;
dkim=pass (1024-bit key; unprotected) header.d=example.com header.i=#example.com header.b=CktBFAHr;
dkim-atps=neutral
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-tester.com
X-Spam-Level:
X-Spam-Status: No/-0.1/5.0
X-Spam-Test-Scores: DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,
SPF_PASS=-0.001,T_RP_MATCHES_RCVD=-0.01
X-Spam-Last-External-IP: XXX.XX.X.XXX
X-Spam-Last-External-HELO: mail.example.com
X-Spam-Last-External-rDNS: mail.example.com
X-Spam-Date-of-Scan: Tue, 20 Mar 2018 22:12:50 +0100
X-Spam-Report:
* -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
* domain
* -0.0 SPF_PASS SPF: sender matches SPF record
* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
* domain
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=XXX.XX.X.XXX; helo=mail.example.com; envelope-from=diana#example.com; receiver=someid#mail-tester.com
DMARC-Filter: OpenDMARC Filter v1.3.1 mail-tester.com 8D270A56BF
Authentication-Results: mail-tester.com; dmarc=pass header.from=example.com
Authentication-Results: mail-tester.com;
dkim=pass (1024-bit key; unprotected) header.d=example.com header.i=#example.com header.b=CktBFAHr;
dkim-atps=neutral
Received: from mail.example.com (mail.example.com [XXX.XX.X.XXX])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mail-tester.com (Postfix) with ESMTPS id 8D270A56BF
for <someid#mail-tester.com>; Tue, 20 Mar 2018 22:12:49 +0100 (CET)
Authentication-Results: mail.example.com (amavisd-new);
dkim=pass (1024-bit key) reason="pass (just generated, assumed good)"
header.d=example.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=
example.com; h=date:date:message-id:from:from:subject
:subject:to:mime-version:content-type:content-type; s=dkim; t=
1521580077; x=1522444078; bh=TlT4DDWYdTBodPmtN0k/UUjJKsfuwGfVa+p
3RfS7B2o=; b=CktBFAHrWBH8zJY5d/A5VxiAYybD2hX5O+u6tJ6I7itc+QAeFyo
9a1cQjFvhw6PyftRVM/eAwAd6ns4pejY5fubMSFl29SUosqV1nXVmxr8xzV0RBTP
/L0o6gpSWAgYGzV++qw5QIRlwA0VCqNGD/wrUoZybijvp9QHgwYx6FPg=
X-Virus-Scanned: Debian amavisd-new at
Content-Type: multipart/mixed; boundary="===============7137656464834900843=="
MIME-Version: 1.0
To: someid#mail-tester.com
Subject: The e-mail subject
From: Princess Diana <diana#example.com>
Message-Id: <20180320210757.24D3E50C0FC9#mail.example.com>
Date: Tue, 20 Mar 2018 17:07:57 -0400 (EDT)
--===============7137656464834900843==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Just a small test....
--===============7137656464834900843==--
Now, everything is setup and OK, the DKIM, SPF, and DMARC.
I'm trying to remove X-Spam-Last-External-IP: XXX.XX.X.XXX header that forwards client IP, and to somehow modify Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=XXX.XX.X.XXX; helo=mail.example.com; envelope-from=diana#example.com; receiver=someid#mail-tester.com which also forwards client IP to every e-mail sent.
I've had no success in removing the first header or modifying the second one.
Also, the e-mail never get into an Hotmail mailbox, not even from RoundCube, and mail.log file shows a successful queued for delivery message. What am I doing wrong?
When connecting over SMTP most servers will add a Received: header with the relevant details. This is an important part of the email reputation ecosystem since it means sending IPs must be accountable for their sending activity.
If you make use of an email relay that may shift the address shown one step down the chain, or you can choose to use an API-driven email service where there's no direct SMTP connection between your application and the mail service. In those cases the IP shown is almost always the mail service you're using and not your own system, giving you a layer of separation and security.

emails are sent to spam folder despite having DKIM and SPF set?

My emails are delivered to spam folder at gmail and yahoo mail.
PTR, DKIM (1024 bit), SPF are okay. I don't know whether DMARC and ADSP or Domain Key are needed to be configured or else?
In addition, I have checked Bulk Senders Guidelines "support.google.com/ ----> mail/answer/81126" but I think I am in compliance with it, except the Format section of the webpage. I wonder is my email header is ISO-8859-1 compliant as is requested by gmail or my messages are formatted according to RFC 5322 as it is required!?
However, I have checked my email by various tools including:
1- www.brandonchecketts.com/emailtest.php
2- mail-tester.com (my email score: 10/10)
3- toolbox.googleapps.com ----> /apps/messageheader/analyzeheader
and all of them are ok and I can't get it right why my emails are categorised as spam?
By the way, I am not a bulk sender, my ip is clean (not in any of blacklists) and I have just started to configure my new VPS host.
I am confused a bit as it is obvious, Please guide me.
Note: (I have changed email addresses and real IPs in the message header)
Here is the header:
Delivered-To: user#gmail.com
Received: by 10.194.95.197 with SMTP id dm5csp291965wjb;
Fri, 30 Jan 2015 06:02:17 -0800 (PST)
X-Received: by 10.180.206.147 with SMTP id lo19mr5212607wic.32.1422626536876;
Fri, 30 Jan 2015 06:02:16 -0800 (PST)
Return-Path: <user#myemail.com>
Received: from myemail.com (myemail.com. [97.195.90.210])
by mx.google.com with ESMTPS id s3si20803914wjx.75.2015.01.30.06.02.16
for <user#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 30 Jan 2015 06:02:16 -0800 (PST)
Received-SPF: pass (google.com: domain of user#myemail.com designates 97.195.90.210 as permitted sender) client-ip=97.195.90.210;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of user#myemail.com designates 97.195.90.210 as permitted sender) smtp.mail=user#myemail.com;
dkim=pass header.i=#myemail.com
Received: from webmail.myemail.com (localhost.localdomain [127.0.0.1])
by myemail.com (Postfix) with ESMTPA id 0D4A122FAEF
for <user#gmail.com>; Fri, 30 Jan 2015 15:02:14 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=myemail.com;
s=default; t=1422626535;
bh=mg3gRDZT3ck+E3FdH2X4LLdsZ/+WeZuit/DVefJiJWc=;
h=Date:From:To:Subject;
b=NhJPZML/OvA/2LJbvqKxnV7AO3TeGPdDqwBI+iOceZk2bz2flsCun3AqJ4RPY8pqM
is+dlQWTFCmQ2T2He7cKU/nC28FmPY4cqwJgt6oSIW0bIWkh81JdzBZXoIDiBGGlkx
mkrpvKQ4vdFh2R7iIRmUJMJtAGWr7MGoS/J7sdi0=
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
format=flowed
Content-Transfer-Encoding: 7bit
Date: Fri, 30 Jan 2015 17:32:14 +0330
From: user#myemail.com
To: user#gmail.com
Subject: Hello
Message-ID: <7582a20431ca444b255e5e835e6ee87d#myemail.com>
X-Sender: user#myemail.com
User-Agent: Roundcube Webmail/1.0.0
Regards
Since you've said that you've modified the header records, it's hard to determine a few things. However, the sending mail server seems to be webmail.domain.com --- Are the DNS records set to point to mail.domain.com or webmail.domain.com or both?
Since you've done the rest of the configuration: just enter a dmarc DNS record, it might increase your server's reputation. Speaking of reputation, if your email server only handles a few emails a day from a couple of users - then your reputation as a 'spammy' server can be greatly affected by a just a few unopened or manually spam marked messages. Also, I believe there's a time lag between when you setup a mail server and when it's reputation gets out of the 'default to spam' folder.

Registration email sent are classified as spam

registration email sent from a new website I am building end up in the receivers' spam folders, they are classified as spam. So far I have no idea why this happens. Therefore I am posting the email header of such a registration email. Please note that this email posted here has not been classified as spam, however all registration emails generated and sent are like this one.
Return-Path: c...t#l...friends.net
Received: from relay02.alfahosting-server.de ([109.237.142.238]) by
mx-ha.gmx.net (mxgmx008) with ESMTP (Nemesis) id 0LkCb4-1U3Xb718IM-00cB3P for
<hamstino007990#gmx.de>; Thu, 23 May 2013 23:44:03 +0200
Received: by relay02.alfahosting-server.de (Postfix, from userid 1001)
id CBFAD32C008C; Thu, 23 May 2013 23:44:02 +0200 (CEST)
X-Spam-DCC: :
X-Spam-Level:
X-Spam-Status: No, score=-0.2 required=7.0 tests=BAYES_40,HTML_MESSAGE
autolearn=disabled version=3.2.5
Received: from alfa3060.alfahosting-server.de (alfa3060.alfahosting-server.de [109.237.138.46])
by relay02.alfahosting-server.de (Postfix) with ESMTP id 9EF9232C00C6
for <hamstino007990#gmx.de>; Thu, 23 May 2013 23:44:00 +0200 (CEST)
Received: by alfa3060.alfahosting-server.de (Postfix, from userid 2905)
id 9DDB32FFBE6B; Thu, 23 May 2013 23:44:00 +0200 (CEST)
To: hamstino007990#gmx.de
Subject: =?utf-8?Q?Willkommen_bei_LanguageFriends.net!?=
X-PHP-Script: staging.languagefriends.net/index.php for 77.58.5.166
User-Agent: CodeIgniter
Date: Thu, 23 May 2013 23:44:00 +0200
From: "L...Friends.net" <c...t#L...Friends.net>
Reply-To: "L...Friends.net" <c...t#L...Friends.net>
X-Sender: c...t#L...Friends.net
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <519e8da0993a5#L...Friends.net>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_519e8da0993ea"
X-Virus-Status: No
X-Virus-Checker-Version: clamassassin 1.2.4 with ClamAV 0.97.3/17264/Thu May 23 18:12:25 2013
Envelope-To: <hamstino007990#gmx.de>
X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3;
X-GMX-Antivirus: 0 (no virus found)
Thanks very much for any support.
Regards
Sebastian
Do you have a proper SPF record set up for your domain? Most domains should respect whatever address your mail is coming from as long as it is in your SPF record. Wikipedia has a pretty good write-up on how SPF works.

Google Apps Gmail SPF error

I moved one client to Google Apps and it's been crazy! So many problems! And I never had these kind of problems
Client is using Outlook with Imap to manage his Google Apps Gmail account
Now when he sends email he got this kind of errors (for some addresses only):
Delivery to the following recipient failed permanently:
spf-test#openspf.org
Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 550 550 5.7.1 <spf-test#openspf.org>: Recipient address rejected: SPF Tests: Mail-From Result="pass": Mail From="nelson#samarfil.com" HELO name="mail-qa0-f45.google.com" HELO Result="none" Remote IP="209.85.216.45" (state 13).
----- Original message -----
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=samarfil.com; s=google;
h=mime-version:x-originating-ip:date:message-id:subject:from:to
:content-type;
bh=bjpej8F5vAhPQFF4gZXUvUHOGuDj2lURhN5uAXH+4o4=;
b=Gvhx7DYYlBFN1b0DQDDTq7Ll0tiGrrzMRGxVnIXOlbr8E3xhtY/lJGNcETSNDIblTT
yQHNyBlnPZxm2AqN8aeJ60lM54QofFtEt4jZe4V0b9WkP8rBXl5KbEfADcJw3kgZQMN/
8I0cpLYALe4YJ0PX8ZCXbtmFtd7m/Jmc/vKEo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=google.com; s=20120113;
h=mime-version:x-originating-ip:date:message-id:subject:from:to
:content-type:x-gm-message-state;
bh=bjpej8F5vAhPQFF4gZXUvUHOGuDj2lURhN5uAXH+4o4=;
b=fdNJWqcTEv1GE5giglb7CBRbU5+1w0VBF8DGjAN2YlrNH624no/00JcJgu/cyw7eAs
cIUUsU2vjMr7Kjjmc3xKbadMyF3A7b7u36l2t80aknCTdkSQuZ6yKT1EYY3INVUhue4Y
Ml7qNaSiAPhNEHlzEttJn/OFYgPeG0rSC8OM5MyZdY6gE64bqrDLH/3chq/0M+yHclon
hEYO7VytoV3BsNxr/HvEJEyNcHtTeX+WsVmxtNc5qgpxytbtReHEjl94auifz/YN16mg
wyC7LUXIBfF3Tffs0NIL5ITwQIj4rSKNm/4N20bfWa6uPJn/30J1uvVoRjHegDtwYQyK
yt8g==
MIME-Version: 1.0
Received: by 10.224.70.138 with SMTP id d10mr27073000qaj.12.1350404560884;
Tue, 16 Oct 2012 09:22:40 -0700 (PDT)
Received: by 10.49.24.205 with HTTP; Tue, 16 Oct 2012 09:22:40 -0700 (PDT)
X-Originating-IP: [94.133.34.4]
Date: Tue, 16 Oct 2012 17:22:40 +0100
Message-ID: <CACP3cFsLYGus9Sr-cbuEFezBEXhdzSJ6gqGPOJr___UJARaBMw#mail.gmail.com>
Subject:
From: Nelson Santos <nelson#samarfil.com>
To: spf-test#openspf.org
Content-Type: multipart/alternative; boundary=bcaec51a81ec2793fc04cc2f90aa
X-Gm-Message-State: ALoCoQkvxVOP+l0d4ugZSxBkKf6IBmd7UYEWPxtodPNh+L5hBOkQD2zREymT1Eal1lH9JUSgBavX
I've already configured DNS to TXT record v=spf1 include:_spf.google.com ~all
what else can I do to fix this?
It's normal to receive this message, as that SPF test uses the error message to send back results. Are you experiencing errors when sending to other addresses?

Resources