Several emails sent from my webserver to a Gmail address, where the From:
address is websitevisitor@gmail.com
, have been marked as spam by Gmail. The From:
field is populated from form data, and corresponds to the visitor's actual email address, which often is a Gmail address. The Return-Path:
is always pointing to an address account@mywebserver.com
, which means that SPF and DKIM checks will work.
When I inspect the raw emails in the Gmail account, I see the following:
Delivered-To: webformrecipient@gmail.com
...
Return-Path: <account@mywebserver.com>
Received: from mywebserver.com (mywebserver.com. [my:ipv6:address])
by mx.google.com with ESMTPS id xxx
for <webformrecipient@gmail.com>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 02 Feb 2016 00:40:02 -0800 (PST)
Received-SPF: pass (google.com: domain of account@mywebserver.com designates my:ipv6:address as permitted sender) client-ip=xxx;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of account@mywebserver.com designates my:ipv6:address as permitted sender) smtp.mailfrom=account@mywebserver.com;
dkim=pass header.i=@mywebserver.com;
dmarc=fail (p=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mywebserver.com; s=mydkim;
h=Date:Message-Id:Sender:From:Subject:To; bh=w2snQznwxlVRVACmfQELC7VGmD1dcYdiCXbCIRYFKRs=;
b=a0Vy3Ky43J5FdiWSuQ4qvTTH47G+Js0W/qtRU5gMlxfesNqrlyaIyExaIZlWvHNL4o0LNOF1GI94w4C41mmH+2JIkMEQZazw0MainP7UyUgsm/RZbAWoRuecPv+k108FlsWMP/l1UttXAdlvBVJmV2UGsYYlSSjKErQEF8tv3K0=;
Received: from apache by mywebserver.com with local (Exim 4.80)
(envelope-from <account@mywebserver.com>)
id 1aQWVF-00009b-2X
for webformrecipient@mywebserver.com; Tue, 02 Feb 2016 09:40:01 +0100
To: webformrecipient@mywebserver.com
From: Website User <website-user@gmail.com>
Sender: webformrecipient@mywebserver.com
...
Note that both the SPF and DKIM checks are passing, but the DMARC check is not. After some searching, I tracked this down to DMARC using the From:
address to get its reference domain from, according to this answer on stack overflow.
Three questions:
- Is it likely that indeed the
dmarc=fail
is the cause of the email being assigned to spam by Gmail? - Why does DMARC operate on the
From:
address, rather than theReturn-Path
(envelope sender) as SPF and DKIM do? - If now also the
From:
header has to correspond to an address@mydomain.com
then how should we specify the actual (logical, flesh and blood) sender of the message?