Several emails sent from my webserver to a Gmail address, where the
From: address is
email@example.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
firstname.lastname@example.org, 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: email@example.com ... Return-Path: <firstname.lastname@example.org> Received: from mywebserver.com (mywebserver.com. [my:ipv6:address]) by mx.google.com with ESMTPS id xxx for <email@example.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 firstname.lastname@example.org designates my:ipv6:address as permitted sender) client-ip=xxx; Authentication-Results: mx.google.com; spf=pass (google.com: domain of email@example.com designates my:ipv6:address as permitted sender) firstname.lastname@example.org; dkim=pass email@example.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 <firstname.lastname@example.org>) id 1aQWVF-00009b-2X for email@example.com; Tue, 02 Feb 2016 09:40:01 +0100 To: firstname.lastname@example.org From: Website User <email@example.com> Sender: firstname.lastname@example.org ...
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.
- Is it likely that indeed the
dmarc=failis the cause of the email being assigned to spam by Gmail?
- Why does DMARC operate on the
From:address, rather than the
Return-Path(envelope sender) as SPF and DKIM do?
- If now also the
From:header has to correspond to an address
@mydomain.comthen how should we specify the actual (logical, flesh and blood) sender of the message?