RFC 7960
Interoperability Issues between Domain-based Message Authentication, Reporting, and Conformance (DMARC) and Indirect Email Flows
RFC 7960: Interoperability Issues between DMARC and Indirect Email Flows ๐งโจ
okay so this RFC is literally about when DMARC and indirect email flows clash ๐ It's an Informational doc, which means it's sharing info, not a standards-track spec ๐ซถ It came out in September 2016 with ISSN 2070-1721. The editors are F. Martin (LinkedIn), E. Lear (Cisco Systems GmbH), T. Draegen (dmarcian, inc.), E. Zwicky (Yahoo), and K. Andersen (LinkedIn), all listed as Ed. ๐ธ The title block doesn't list anything it obsoletes or updates, so it's a standalone vibe ๐ฆ
Abstract ๐
DMARC gives domains a way to express domain-level policies and preferences for email message validation, disposition, and reporting ๐ But when messages don't flow directly from the author's administrative domain to the final Recipients, DMARC can cause some seriously disruptive interoperability issues ๐ญ These flows are called "indirect email flows". This doc describes those issues and presents possible ways to address them โจ
Status of This Memo ๐
This doc is not an Internet Standards Track spec. It's published for informational purposes ๐
It's a product of the Internet Engineering Task Force (IETF) and represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). Not every doc the IESG approves is a candidate for any level of Internet Standard, so check Section 2 of RFC 7841 for the deets ๐
Info about the current status of this doc, any errata, and how to send feedback lives at http://www.rfc-editor.org/info/rfc7960 ๐
Copyright Notice ๐ง
Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved. ๐
This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as in effect on the date of publication. Please read these carefully, because they spell out your rights and restrictions for this doc ๐ซถ Code Components extracted from this doc must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they're provided without warranty as described in the Simplified BSD License ๐ฅ
Table of Contents ๐
1. Introduction ....................................................3
1.1. Document Conventions .......................................4
2. Causes of Interoperability Issues ...............................4
2.1. Identifier Alignment .......................................4
2.1.1. DKIM Identifier(s) ..................................5
2.1.2. SPF Identifier(s) ...................................6
2.1.3. Multiple RFC5322.From Addresses .....................6
2.2. Message Forwarding .........................................6
2.3. Message Modification .......................................7
3. Internet Mail Architecture, DMARC, and Indirect Email Flows .....8
3.1. Message Handling System ....................................8
3.1.1. Message Submission Agents ...........................8
3.1.2. Message Transfer Agents .............................9
3.1.2.1. Message Encoding ...........................9
3.1.2.2. Header Standardization ....................10
3.1.2.3. Content Validation ........................10
3.1.3. Message Delivery Agents ............................10
3.2. Mediators .................................................11
3.2.1. Alias ..............................................11
3.2.2. ReSenders ..........................................12
3.2.3. Mailing Lists ......................................12
3.2.3.1. Mailing List Operational Effects ..........13
3.2.4. Gateways ...........................................13
3.2.5. Boundary Filters ...................................14
3.3. Combinations ..............................................15
4. Possible Mitigations of Interoperability Issues ................15
4.1. Mitigations in Current Use ................................16
4.1.1. Mitigations for Senders ............................16
4.1.1.1. Identifier Alignment ......................16
4.1.1.2. Message Modification ......................17
4.1.2. Mitigations for Receivers ..........................17
4.1.2.1. Identifier Alignment ......................17
4.1.2.2. Policy Override ...........................17
4.1.3. Mitigations for ReSenders ..........................18
4.1.3.1. Changes to the RFC5322.From ...............18
4.1.3.2. Avoiding Message Modification .............18
4.1.3.3. Mailing Lists .............................18
4.2. Proposed and In-Progress Mitigations ......................20
4.2.1. Getting More Radical: Requiring New
Communication Paths between MUAs ...................21
5. Security Considerations ........................................21
6. References .....................................................22
6.1. Normative References ......................................22
6.2. Informative References ....................................23
Appendix A. Example SPF Bounce ...................................24
A.1. Initial Message ...........................................24
A.2. Notification Message ......................................25
Acknowledgments ...................................................26
Authors' Addresses ................................................27
1. Introduction โจ
DMARC [RFC7489] gives domains a way to express domain-level policies and preferences for message validation, disposition, and reporting ๐ The DMARC mechanism, especially with restrictive policies, runs into several different kinds of interoperability issues caused by third-party message sourcing, message transformation, or rerouting ๐ญ In particular, DMARC with restrictive policies causes problems for many Mailing Lists ๐
When this doc was written, the DMARC base spec had been published as Informational RFC 7489 [RFC7489], and it had seen significant deployment across the email community ๐
Cases where email doesn't flow directly from the author's administrative domain to the recipient's domain(s) are collectively called "indirect email flows" in this doc. Since DMARC adoption is already widespread and still growing, the impact of DMARC-based rejection policies on indirect email flows can be significant for a select subset of general email traffic ๐ฆ
A few known causes of interoperability issues get presented first, followed by a look at the parts of the Internet Mail Architecture [RFC5598] where these issues can pop up ๐งฉ
Last up, known and possible ways to address interoperability issues get presented. There are often multiple ways to fix any given issue. This doc really tries to be comprehensive, but it shouldn't be treated as complete ๐ธ
Heads up that some practices in use at the time of this doc may or may not be "best practices", especially as future standards evolve ๐
1.1. Document Conventions ๐
The notation this doc uses for structured fields is taken from [RFC5598], Section 1.3 ๐
The term "notification message" ([RFC5321], Section 4.5.5) refers to a message with a null RFC5321.MailFrom ๐
The terms "Organizational Domain" and "Authenticated Identifiers" are specified in DMARC ([RFC7489], Section 3) ๐ซถ
All words that begin with capital letters take their formal meanings from these references ๐
2. Causes of Interoperability Issues ๐
Interoperability issues between DMARC and indirect email flows happen when following the DMARC spec leads a receiving implementation to apply DMARC-based policy restrictions to messages that are both compliant with the architecture in [RFC5598] and seen as legitimate by the intended Recipient ๐ค
Domains that assert a p=none policy, and email messages that pass standard DMARC validation, don't have any interoperability issues ๐ฅณ
Email messages that don't conform to IETF email specs but are still considered legitimate by the intended Recipients aren't discussed in this doc ๐
The rest of this section describes several conceptual causes of interoperability issues โจ
2.1. Identifier Alignment ๐
Note to operators and administrators: the identifiers used by the Sender Policy Framework (SPF) are technical parts of the SMTP transport process. As described below, they may or may not have a meaningful relationship to the content or source of the message itself. This "relationship by proximity" can be a point of confusion for non-technical end users, whether they're recipients or senders ๐ค
DMARC relies on DomainKeys Identified Mail (DKIM) [RFC6376] and SPF [RFC7208] to do message source validation ๐ก๏ธ The DMARC [RFC7489] spec refers to source domains validated by DKIM or SPF as "Authenticated Identifiers" ๐ชช To be used by DMARC, an "Authenticated Identifier" must also be related to the domain in the message's RFC5322.From header field [RFC5322] ๐
That relationship between an Authenticated Identifier's domain and the domain of the RFC5322.From is called "Identifier Alignment" ๐
DMARC lets Identifier Alignment be determined in two modes: strict and relaxed ๐ Strict mode requires an exact match between the domain of any Authenticated Identifier and the message's RFC5322.From header field [RFC5322]. Relaxed mode allows Identifier Alignment if the Authenticated Identifiers and the message's RFC5322.From header field [RFC5322] share the same Organizational Domain ๐ Generally, DMARC interoperability issues are the same under strict and relaxed alignment, but strict alignment limits the possible solutions because its matching requirement is more rigorous ๐ฌ Some of the mitigations in this doc only work with the relaxed mode of Identifier Alignment ๐ซ
2.1.1. DKIM Identifier(s) ๐
okay bestie, so DKIM gives you a cryptographic way to attach one or more domain identifiers to a message ๐ on its own, DKIM identifiers don't have to be related to where the message content came from ๐คทโโ๏ธ BUT for a DKIM identifier to align in DMARC, the signing domain of a valid signature has to be part of the same Organizational Domain as the domain in the RFC5322.From header field [RFC5322]. that's the whole game ๐
DKIM also allows a message to carry multiple valid signatures ๐ฆ those can come from the same domain or different domains, and the DKIM spec doesn't put any restrictions on it ๐ DMARC will keep checking the Authenticated Identifiers based on DKIM signatures until it finds an aligned one (if there is one at all) ๐ but ngl, operators have noticed that some implementations struggle with multiple signatures ๐ญ Implementations that can't handle multiple DKIM signatures may wrongly flag messages as "not passing" (DMARC alignment) and then apply DMARC-based policy to messages that were actually fine ๐ not it.
2.1.2. SPF Identifier(s) ๐ธ
The SPF spec [RFC7208] defines two Authenticated Identifiers for each message ๐ they come from:
a. the RFC5321.MailFrom [RFC5321] domain, and
b. the RFC5321.HELO/.EHLO SMTP domain.
Here's the tea โ in the SPF spec, the RFC7208.MAILFROM [RFC7208] value is based on RFC5321.MailFrom, unless that value is absent (like with notification messages). In that case, the second one, the RFC5321.HELO/.EHLO identifier value, gets used. This "fallback" definition has occasionally been misunderstood by MTA operators, since notification messages are often an "automatic" feature of MTA software ๐ค and some MTA software doesn't let you apply a DKIM signature to those notification messages at all ๐ค
See Appendix A for an example treatment of this scenario ๐
For DMARC validation/alignment purposes, the hybrid RFC7208.MAILFROM [RFC7208] identifier's domain gets used if and only if it's aligned with the RFC5322.From [RFC5322] domain. How alignment of the validated domain gets decided depends on whether the DMARC record says "strict" or "relaxed", as described above for the DKIM identifiers and in [RFC7489] โจ
2.1.3. Multiple RFC5322.From Addresses ๐ฏ
[RFC5322] permits only one From header field, but that field can contain multiple mailboxes ๐ฌ since this is an extremely rare usage, DMARC says the handling of this situation is implementation dependent ๐ค
๐จ Multiple domains are a red flag! An attacker could add their own domain to the RFC5322.From field, slip in arbitrary new content, and sign the message. So DMARC recommends applying the strictest policy to such messages (Section 6.6.1 of [RFC7489]) ๐ก๏ธ
2.2. Message Forwarding ๐จ
Section 3 describes forwarding behavior as it relates to the components of the Internet Mail Architecture ๐๏ธ
Every forwarding operation involves retransmitting the email ๐ as we said above, for SPF to produce an Authenticated Identifier that's relevant to DMARC, the domain of the RFC7208.MAILFROM has to be in alignment with the RFC5322.From header field. Forwarding causes specific problems for SPF-based Authenticated Identifiers:
- If the RFC5321.MailFrom is present and the forwarder keeps the original RFC5321.MailFrom, SPF validation will fail unless the forwarder is an authorized part of the originator's email sending infrastructure ๐ฌ If the forwarder swaps the RFC5321.MailFrom for its own domain, SPF might pass, but Identifier Alignment with the RFC5322.From header field will fail ๐
- If the RFC5321.MailFrom is empty (like with Delivery Status Notifications), the RFC5321.HELO/.EHLO domain of the forwarder will likely be in a different Organizational Domain than the original RFC5322.From header field's domain. SPF may pass, but Identifier Alignment with the RFC5322.From header field will fail ๐
In both cases, SPF can't produce relevant Authenticated Identifiers, so DKIM has to carry the load to produce results that are relevant to DMARC ๐ฆธโโ๏ธ
2.3. Message Modification โ๏ธ
Changing email content invalidates most DKIM signatures, and lots of message-forwarding systems modify content ๐ Mailing List processors are a classic example, but other forwarding systems make changes too ๐
Although DKIM has a length flag so content can be appended without invalidating the signature, in practice (especially with MIME-encoded [RFC2045] messages), a Mailing List processor does more than just append content (see Section 5.3 of [RFC5598] for details) ๐ตโ๐ซ Plus, the length flag is seldom used because of security issues (see Section 8.2 of [RFC6376] for additional security considerations). So this method is only mentioned here for completeness ๐ซ
DKIM describes two canonicalizations for preparing the header and body for DKIM processing: simple and relaxed ๐ relaxed is designed to handle trivial changes to whitespace and folding that, at least in the header case, generally don't have any semantic significance. But relaxed canonicalization is more computationally intensive, so it may not have been the go-to in early DKIM deployments, which left some deployments using the less forgiving "simple" canonicalization ๐ฅฒ The prevalence is unknown, but some DKIM verifiers have problems evaluating relaxed canonicalization correctly ๐
3. Internet Mail Architecture, DMARC, and Indirect Email Flows ๐๏ธ
This section covers the components within the Internet Mail Architecture [RFC5598] where interoperability issues between DMARC and indirect email flows can show up ๐
3.1. Message Handling System ๐ฌ
Section 4 of [RFC5598] describes six basic components that make up the Message Handling System (MHS) ๐
- Message
- Message User Agent (MUA)
- Message Submission Agent (MSA)
- Message Transfer Agent (MTA)
- Message Delivery Agent (MDA)
- Message Store (MS)
Of these, the MSA, MTA, and MDA are the ones discussed in relation to DMARC interoperability ๐ซถ
Section 5 of [RFC5598] also defines a Mediator as a hybrid of several component types ๐ง A Mediator gets special attention in this section because of the unique issues they face when trying to interoperate with DMARC ๐ญ
3.1.1. Message Submission Agents ๐ฎ
An MSA accepts messages submitted by a Message User Agent (MUA) and enforces the policies of the hosting ADministrative Management Domain (ADMD) and the requirements of Internet standards ๐
MSAs are split into two sub-components:
- Author-focused MSA functions (aMSA)
- MHS-focused MSA functions (hMSA)
MSA interoperability issues with DMARC begin when an aMSA accepts a message where the RFC5322.From header field contains a domain outside the ADMD of the MSA ๐ฉ This can happen in a few ways, like when someone uses a mail service with their own domain but never properly set up an SPF record, or when an MUA tries to send mail as someone else ๐ Examples of the latter include "forward-to-friend" features on news/article websites, or "send-as" features on some MUAs ๐ฐ
When an hMSA takes responsibility for transit of a message whose RFC5322.From header field contains a domain outside the hMSA's ADMD, the hMSA runs into DMARC interoperability issues if that domain publishes a DMARC policy of "quarantine" or "reject" ๐ฌ These issues show up as the inherent difficulty of establishing alignment with the domain in the message's RFC5322.From header field. Examples include:
- Partially open relays - a residential ISP that lets its customers relay non-local domains through its infrastructure ๐
- Embedded devices - cable/DSL modems, firewalls, wireless access points, and printers that send email using hardcoded domains ๐จ๏ธ
- Devices that send mail on behalf of a user - scanners, security cameras, and alarms that send mail as their owner or a device user ๐ท
- Email service providers - ESPs that serve customers using domains that publish a DMARC "reject" policy ๐ผ
- Calendaring software - an invited member of an event modifies the event, causing the calendaring software to send an update that claims to come from the event's creator ๐ ๐
3.1.2. Message Transfer Agents ๐
MTAs relay a message until it reaches a destination MDA ๐ฃ๏ธ Some common message-handling strategies break the integrity of DKIM signatures. A restrictive DMARC policy plus a broken DKIM signature turns latent interoperability problems into overt problems ๐จ
3.1.2.1. Message Encoding ๐ค
An MTA may modify the message encoding, for instance by converting 8-bit MIME sections to quoted-printable 7-bit sections ๐ This modification is outside the scope of DKIM canonicalization and will invalidate DKIM signatures that include message content ๐
An MTA could also re-encode the message without changing the encoding type: it receives a MIME-encoded message and produces a semantically and semiotically equivalent MIME body that isn't identical to the original ๐ช This is typical of systems that use some other message representation internally ๐ง
3.1.2.2. Header Standardization ๐งพ
An MTA may rewrite headers to bring them into compliance with existing RFCs. For example, some common MTAs will fix comprehensible but non-compliant date formats so they become compliant ones ๐
Header rewriting is outside the scope of DKIM canonicalization and will invalidate DKIM signatures ๐ฉ All downstream DMARC processing will be unable to use DKIM to produce Authenticated Identifiers because of the header rewriting ๐ โโ๏ธ
Providing solutions for issues relating to non-RFC-compliant emails is outside the scope of this document ๐
3.1.2.3. Content Validation ๐ก๏ธ
An MTA may also implement security-motivated changes to message content, dropping or altering sections of messages, which causes DKIM signatures to break ๐
3.1.3. Message Delivery Agents ๐ฅ
The MDA transfers a message from the MHS to a mailbox ๐ซ Like the MSA, the MDA has two sub-components:
- MHS-focused MDA functions (hMDA)
- Recipient-focused MDA functions (rMDA)
Both the hMDA and the rMDA can redirect a message to an alternative address ๐ DMARC interoperability issues related to redirecting messages are described in Section 3.2 ๐งฉ
Sieve [RFC5228] functionality often lives in the rMDA sub-component and can cause DMARC interoperability issues ๐ซฃ The Sieve 'addheader' and 'deleteheader' filtering actions can modify messages and invalidate DKIM signatures, which removes DKIM-supplied Authenticated Identifiers as inputs to the DMARC mechanism ๐ There are also Sieve extensions [RFC5703] that modify the body ๐ Sieve alterations may only become an issue when the email is reintroduced into the transport infrastructure โจ
3.2. Mediators
Okay bestie, so Mediators ๐ are the ones that forward messages through a re-posting process, and they're basically cousins of plain MTA relaying but with way more freedom in both addressing and content changes โจ. [RFC5598] is where they're defined, so go check that out ๐ฆ.
Mediators are lowkey DMARC's biggest headache ๐ญ. Interoperability issues are super common here, and that's literally because Mediators get used precisely for their ability to modify messages ๐.
The DMARC design just doesn't cope with some Mediator stuff ๐. Like, content modifications that break DKIM signatures? Not handled. And RFC5321.MailFrom rewriting, which is needed so SPF can still authenticate re-sent mail when the new Recipient gets the message from the Mediator instead of the original organization? Also not handled ๐ค.
3.2.1. Alias
An Alias is a simple re-addressing facility ๐. Instead of one internal address, it gives you one or more brand new Internet Mail addresses ๐ธ. The message keeps moving through the transfer service until it reaches one or more alternative addresses ๐ง.
Aliases can be done with mailbox-level forwarding (think "dot-forwarding" ๐), with Sieve-level forwarding (through the Sieve "redirect" action โจ), or with other methods ๐. Here's the tea โ: if an Alias keeps the message content intact and doesn't make big header changes, DKIM signatures may stay valid ๐ซถ. BUT Aliases often stretch the delivery path outside the originating ADMD's SPF record(s), so SPF can get messy ๐ฌ.
Examples of Aliasing include:
- Forwarding email between free email (freemail) providers so you can try different interfaces while keeping your original email address ๐ ;
- Consolidating a bunch of email addresses into one account to centralize processing ๐; and
- Services that give you "activity-based", "role-based", "vanity", or "temporary" email addresses, like universities and professional associations ๐. For example, professional or alumni institutions might give members an Alias for as long as they're a member, but not want to store their emails long-term ๐ฆ.
Most of the time, the aMSA providing Alias services has no administrative relationship with the ADMD of the originator or the Final Recipient ๐. So if you're fixing an Alias-related DMARC failure, you SHOULD NOT assume such a relationship exists ๐.
Oops, wait, I need to fix that. Here's the correct line:
Most of the time, the aMSA providing Alias services has no administrative relationship with the ADMD of the originator or the Final Recipient ๐. So solutions to Alias-related DMARC failure should not assume such a relationship ๐ .
3.2.2. ReSenders
ReSenders are the "splicers" ๐ง of the group. They splice a message's addressing info to connect the Author of the original message with the Recipient(s) of the new message โจ. The new Recipient sees the message as coming from the original Author, even if the Mediator adds commentary ๐.
Without Authenticated Identifiers aligned with the Author's RFC5322.From header field domain, the new Recipient has no way to get a passing DMARC evaluation ๐ญ. Yikes.
Examples of ReSenders include MUA-level forwarding, where you resend a message to a new Recipient or forward it "inline" to them (this does NOT include forwarding a message "as an attachment" ๐ ). Another example is calendaring software that lets a meeting attendee (not the meeting organizer) change the content of an invite, generating new invitations that claim to be reissued from the meeting organizer ๐๏ธ๐.
3.2.3. Mailing Lists
A Mailing List receives messages as an explicit addressee and then reposts them to a list of subscribed members ๐. It's basically an elaborate version of what ReSenders do ๐ .
Mailing Lists share the same DMARC interoperability issues as ReSenders (Section 3.2.2) ๐ซถ, and they very commonly modify headers or content in ways that break DKIM, including:
- prepending the RFC5322.Subject header field with a tag, so people can spot the Mailing List in a subject line list ๐ท๏ธ;
- adding a footer to the email body with administrative instructions ๐;
- removing some MIME-parts or converting the message to text only ๐;
- encrypting the body with the Recipient's key using PGP (Pretty Good Privacy) or S/MIME ๐;
- enforcing community standards by rewriting banned words ๐ โโ๏ธ; and
- letting moderators add arbitrary commentary to messages (discussed in [RFC6377]) ๐ฌ.
Any of those modifications would invalidate a DKIM signature ๐.
Header and content changes are super common for Mailing Lists and are often central to how they work today ๐. Plus, MUAs have come to rely on those Mailing List modifications to show messages to end users in the ways they expect ๐ฆ.
3.2.3.1. Mailing List Operational Effects
Mailing Lists may also have these DMARC interoperability issues ๐ฌ:
- Subscribed members may not receive email from members who post using domains that publish a DMARC "p=reject" policy ๐ซ.
- Mailing Lists may read DMARC-related email rejections as an inability to deliver email to the Recipients who are checking and enforcing DMARC policy ๐ค. That can lead to subscribers who are checking and enforcing DMARC policy being accidentally suspended or removed from the Mailing List ๐ญ.
3.2.4. Gateways
A Gateway does the basic routing and transfer work of message relaying ๐ช, but it's also allowed to modify content, structure, addressing, and/or other attributes ๐ . It does this so the message can get into a messaging environment that runs on different standards or potentially incompatible policies ๐ธ.
Gateways share the same DMARC interoperability issues as ReSenders (Section 3.2.2) ๐ซถ. They may also share the same DMARC interoperability issues as MTAs (Section 3.1.2) ๐ง.
Receiver systems on the non-SMTP side of a protocol Gateway may be unable to evaluate DKIM and SPF ๐ต. If a message goes through a second protocol Gateway back into the SMTP domain, those transformations commonly break the original DKIM signature(s) ๐.
Gateway-level forwarding can cause DMARC interoperability issues if the Gateway is set up to rewrite the message into alternate receiving domains ๐. For example, an acquisition might lead an acquiring company to decommission the acquired company's domains by rewriting messages to use the acquiring company's domain ๐ข. Since the RFC5322.To header field is usually DKIM-signed, this kind of rewriting will invalidate those DKIM signatures ๐.
3.2.5. Boundary Filters
To enforce security boundaries, organizations can have messages analyzed for conformance with their safety policies ๐ก๏ธ. A filter might change the content to make it safe, like by removing or otherwise altering content that's deemed unacceptable ๐งผ.
Boundary Filters share the same DMARC interoperability issues as ReSenders ๐ซถ.
Issues may come up with SPF and DKIM evaluation if it's performed after the filter has made modifications ๐ฌ.
Examples of Boundary Filters include:
- Malware scanning ๐ฆ : To protect readers and its reputation, an MTA that transfers a message may remove content believed to be harmful, reformulate content into canonical formats to make it more trustworthy or easier to scan, and/or add text in the body saying the message has been scanned ๐. Any such modifications would invalidate a DKIM signature ๐.
- Spam filtering ๐๏ธ: To protect its reputation and help other MTAs, an MTA may modify a message to indicate its decision that the message is likely unwanted, and/or add text in the body saying that filtering has been done ๐ .
- Other text additions โ๏ธ: An MTA may add an organizational disclaimer or advertisement, for instance ๐ฃ.
- URL alteration ๐: Some systems rewrite or alter embedded URLs as a way to control the potential threat from malware ๐ก๏ธ.
- Secondary MX services ๐ฌ: The secondary MX for an organization may be external to the normal mail processing for that organization, and it may queue messages and forward them to the primary when it becomes available โณ. This won't invalidate DKIM, but it will stop the primary from validating SPF normally ๐ญ. In this case, though, it is inappropriate for a primary MX server to perform an SPF check against its own secondaries ๐ โโ๏ธ. Instead, the secondary MX should do this check and use some trusted mechanism to pass the results of the SPF, DKIM, and DMARC evaluation(s) to the primary MX server ๐ซถ.
3.3. Combinations
Indirect email flows can be combined ๐. For example, a university student may subscribe to a Mailing List using their university email address, while that university address is set up to forward all emails to a freemail or post-education corporate account provider where a more permanent email address for them exists ๐โจ.
Within an organization, a message may pass through various MTAs (Section 3.1.2), each doing a different job (authentication, filtering, distribution, etc.) ๐ง๐ .
4. Possible Mitigations of Interoperability Issues ๐ ๏ธ
Solutions to interoperability issues between DMARC and indirect email flows vary a lot in scope and implications ๐. They range from improvements to underlying processing, like proper handling of multiple DKIM signatures, all the way to more radical changes to the messaging architecture ๐ฅ. This section describes possible ways to address interoperability issues ๐. Heads up though: these particular mechanisms may not be considered "best practices" and may, in some cases, violate various conventions or expectations ๐.
Receivers sometimes need to deliver email messages that don't conform to any standard or protocol, but that end users still want ๐ฌ. Mitigating the impact of DMARC on indirect email flows matters a lot to receivers running services where ease of use and compatibility with existing email flows is a priority ๐ซถ.
DMARC provides a mechanism (local policy) for receivers to make decisions about identity alignment acceptability based on information outside DMARC, and to communicate those decisions as "overrides" to the sender ๐๏ธ. This can help ease some interoperability issues, but care is needed so it doesn't create loopholes for abuse ๐จ.
To complicate things further, mitigation may not be wanted if the email is in a high-value or high-risk (security-related) transactional category, like financial transactions or medical records ๐ฅ. In those cases, mitigating DMARC's impact on indirect email flows may not be desirable (counterproductive or allowing for abuse) โ ๏ธ.
As a final note, mail systems are diverse and widely deployed ๐. Systems of various ages and capabilities are expected to preserve interoperability with the rest of the SMTP ecosystem ๐ซถ. For instance, Qmail is still used, even though the base code hasn't been updated since 1998 ๐ฆ. ezmlm, once a popular MLM, is still deployed but hasn't been updated since 1997, although a new version (ezmlm-idx) exists ๐ฎ. Old versions of other open- and closed-source MTAs are still commonly in operation ๐ฐ๏ธ. When dealing with aging or unsupported systems, some solutions may be time-consuming and/or disruptive to implement ๐ฉ.
4.1. Mitigations in Current Use
Because DMARC is already widely deployed, many operators already have mitigations in use ๐. These mitigations vary in effectiveness and side effects, but they have the advantage that they're available right now ๐.
4.1.1. Mitigations for Senders
4.1.1.1. Identifier Alignment ๐
- okay so MTAs handling multiple domains may choose to change
RFC5321.MailFromto align withRFC5322.From, which makes SPF way more usable for DMARC โจ - MTAs handling multiple domains may also choose to align
RFC5321.HELO/.EHLOtoRFC5322.From, especially when sending notification messages ๐. Dynamically adjusting theRFC5321.HELO/.EHLObased on theRFC5322.Frommay not be possible for some MTA software ๐ญ - MTAs may choose to DKIM-sign notification messages with an aligned domain, which lets them get a DKIM-based DMARC pass ๐ซถ
- MTAs sending email on behalf of multiple domains may require Domain Owners to provide DKIM keys so they can use DKIM and avoid SPF validation issues, given the DMARC alignment requirement for
RFC5322.From๐. Managing DKIM keys with a third party has security risks that should be carefully managed (see also [RFC6376], Section 8) ๐. Methods involving CNAMEs and/or subdomains may alleviate some risks ๐ธ - Senders who are sending on behalf of users in other administrative domains may choose to use an
RFC5322.Fromunder the sender's control. The new From can be either a forwarding address in a domain controlled by the Sender or a placeholder address, with the original user's address in anRFC5322.Reply-toheader field. However, doing this may cause the Recipient's MUA to deviate from customary behavior ๐ - When implementing "forward-to-friend" functionality, one approach to avoid DMARC failures is to pass a well-formed message to the user's MUA so that it may fill in an appropriate identity and submit through its own MSA ๐
- Senders can use domains with distinct DMARC policies for email sent directly and email known to use indirect mail flows. However, for most well-known brands, all active domains are likely to be targeted equally by abusers ๐ฅฒ
4.1.1.2. Message Modification ๐ ๏ธ
- Senders can maximize survivability of DKIM signatures by limiting the header fields they sign and using relaxed canonicalization. Using the DKIM length tag to allow appended signatures is discouraged due to the security risk created by allowing arbitrary content to be appended to legitimate email ๐จ
- Senders can also maximize survivability by starting with RFC-compliant headers and common body formats ๐
- In order to minimize transport-based conversions, Senders can convert messages to a lowest denominator MIME content-transfer encoding such as quoted-printable or base64 before signing ([RFC6376], Section 5.3) ๐ฆ
4.1.2. Mitigations for Receivers ๐
4.1.2.1. Identifier Alignment ๐
- Receivers should update DKIM handling libraries to ensure that they process all valid DKIM signatures and check each signature for alignment ๐ง
4.1.2.2. Policy Override โ๏ธ
- Receivers can amalgamate data from their user base to create lists of forwarders and use such lists to inform DMARC local policy overrides. This process may be easier for large receivers where data and resources to create such lists are more readily available than at smaller sites, where there are fewer accounts that receive forwarded mail and other resources may be scarce ๐
4.1.3. Mitigations for ReSenders ๐ฆ
4.1.3.1. Changes to the RFC5322.From ๐
Many ReSender issues can be avoided by using an RFC5322.From header field under the ReSender's control, instead of the initial RFC5322.From. This will correct Identifier Alignment issues and allow arbitrary message modification as long as the ReSender signs the message with an aligned domain signature. When ReSenders change the RFC5322.From, it is desirable to preserve the information about the original initiator of the message ๐
A first option is to use the Original-From [RFC5703] (or X-Original-From) header field for this purpose in various contexts (X- header field names are discouraged by [RFC6648]). However, handling of Original-From (or X-Original-From) is not defined anywhere. It is not currently used consistently or displayed to the user, and in any situation where it is used, it is a new unauthenticated identifier available for exploitation unless included within the scope of the new DKIM signature(s) ๐ฉ
Another option for ReSenders is to rewrite the RFC5322.From header field address to a locally controlled address that will be forwarded back to the original sender (subject to its own ReSender forwarding mitigations) ๐
4.1.3.2. Avoiding Message Modification ๐
- Forwarders can choose to add email header fields instead of modifying existing headers or bodies, for instance, to indicate a message may be spam ๐
- Forwarders can minimize the circumstances in which they choose to fix messages, preferring to preserve non-compliant headers to creating DKIM failures ๐งฏ
- Forwarders can choose to reject messages with suspect or harmful content instead of modifying them ๐ซ
4.1.3.3. Mailing Lists ๐ฌ
[RFC6377] provides some guidance on using DKIM with Mailing lists. The following mitigation techniques can be used to ease interoperability issues with DMARC and Mailing lists:
- Configuring the Mailing List Manager (MLM) to alter the
RFC5322.Fromheader field to use the domain of the MLM is a mitigation policy that is now present in several different Mailing List software distributions. Since most list subscribers prefer to know the identity of the Author of the original message, typically this information may be provided in the display name part of theRFC5322.Fromheader field. This display name needs to be carefully crafted so as to not collide with the original display name of the Author, nor contain something that looks like an email address or domain name. These modifications may to some extent defeat the purpose of DMARC itself. It may make it difficult to ensure that users of all email clients can easily reply to the Author, the list, or all using the email client features provided for that purpose. Use of theRFC5322.Reply-Toheader field can alleviate this problem depending on whether the Mailing List is configured to reply-to-list, reply-to-author, or reply-to-fixed-address; however, it is important to note that this header field can take multiple email addresses. When altering theRFC5322.From, there are three possibilities:- change it to put the Mailing List email address,
- change it to a locally defined address that will be forwarded back to the original sender, or
- "break" the address by modifying the domain to a non-existent domain (such as by adding a suffix like ".invalid").
The latter modification may create issues because it is an invalid domain name, and some MTAs may pay particular attention to the validity of email addresses in RFC5322.From and the reputation of the domains present there. ๐ซฃ
- Configuring the MLM to "wrap" the message in a MIME message/rfc822 part and to send as the Mailing List email address. Many email clients (as of the publication of this document), especially mobile clients, have difficulty reading such messages, and this is not expected to change soon ๐ฑ
- Configuring the MLM to not modify the message so that the DKIM signature remains valid. Some Mailing Lists are set up this way and require few additional changes to ensure the DKIM signature is preserved. Moving lists that currently modify mail to a policy like this may be too much of a change for the members of such lists ๐คท
- Rejecting posts or membership requests from domains with a DMARC policy other than "p=none". However, members or potential members of such Mailing Lists may complain of unfair exclusion ๐ค
- To alleviate unsubscribes to the Mailing List due to the messages bouncing because of DMARC, the MLM needs to not act on notification messages due to message authentication issues. [RFC3463] specifies Enhanced Mail System Status Codes, which help differentiate between various failure conditions. Correctly interpreting Extended SMTP error messages is useful in this case. In particular, extended status codes for SPF and DKIM causes are defined in [RFC7372], and DMARC-related failure indications are discussed in DMARC ([RFC7489], Section 10.3) ๐ง
All these techniques may provide some specific challenges to MUAs and different operational usages for end users (like rewriting filters to sort emails in folders). There will be some time before all implications are understood and accommodated โณ
4.2. Proposed and In-Progress Mitigations ๐ฎ
The following mitigations are based on Internet-Drafts (I-Ds) that are still in process. They are described here to offer an exploratory path for solutions. These solutions should not be used in a production environment. Because of the transient nature of I-Ds, specific citations are not included because a number of them will inevitably become obsolete, and those that gain consensus in the community will become RFCs and should be discovered as such.
- Third-party authorization schemes provide ways to extend Identifier Alignment under control of the Domain Owner.
- Ways to canonicalize messages that transit Mailing Lists so that their alterations can be isolated from the original signed content.
- Mechanisms to record message transformations applied at each hop so they can be reversed and the original signed content recovered.
- "Conditional" DKIM signatures, whereby the Author domain indicates its signature is only good if accompanied by a signature from an expected downstream relay.
- Mechanisms to extend Authentication-Results [RFC7601] to multiple hops, creating a provable chain of custody as well as a view of message authentication results at each handling step.
4.2.1. Getting More Radical: Requiring New Communication Paths between MUAs ๐
In practice, a number of operators are using strict alignment mode in DMARC in order to avoid receiving new and innovative forms of unwanted and unauthentic email through systems purporting to be Mailing List handlers. The receiving ADMD has no knowledge of which lists the user has subscribed to and which they have not. One avenue of exploration would be for the user to authorize Mailing Lists as proxies for authentication, at which point the receiving ADMD would be vesting some trust in the Mailing List service. The creators of DKIM foresaw precisely this possibility at the time by not tightly binding any semantics to the RFC5322.From header field. Some experimental work has taken place in this area, as mentioned above. Additional work might examine a new communication path to the user to authorize some form of transitive trust. ๐ค
5. Security Considerations ๐จ
This document is an analysis of DMARC's impact on indirect email flows. It describes the possibility of accidental denial of service that can be created by rejections of messages by DMARC-aware mail receivers. ๐ฑ
Section 4.1.1.1 discusses the importance of appropriate DKIM key management vis-a-vis third-party email senders. ๐
Section 4.1.3.3 warns that rewriting the RFC5322.From header field to create an artificial domain name should not be done with any domain. ๐
6. References โจ
6.1. Normative References
[RFC2045]Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996,<http://www.rfc-editor.org/info/rfc2045>. ๐[RFC3463]Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 3463, DOI 10.17487/RFC3463, January 2003,<http://www.rfc-editor.org/info/rfc3463>. ๐[RFC5228]Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email Filtering Language", RFC 5228, DOI 10.17487/RFC5228, January 2008,<http://www.rfc-editor.org/info/rfc5228>. ๐[RFC5321]Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, DOI 10.17487/RFC5321, October 2008,<http://www.rfc-editor.org/info/rfc5321>. ๐[RFC5322]Resnick, P., Ed., "Internet Message Format", RFC 5322, DOI 10.17487/RFC5322, October 2008,<http://www.rfc-editor.org/info/rfc5322>. ๐[RFC5598]Crocker, D., "Internet Mail Architecture", RFC 5598, DOI 10.17487/RFC5598, July 2009,<http://www.rfc-editor.org/info/rfc5598>. ๐[RFC5703]Hansen, T. and C. Daboo, "Sieve Email Filtering: MIME Part Tests, Iteration, Extraction, Replacement, and Enclosure", RFC 5703, DOI 10.17487/RFC5703, October 2009,<http://www.rfc-editor.org/info/rfc5703>. ๐[RFC6376]Crocker, D., Ed., Hansen, T., Ed., and M. Kucherawy, Ed., "DomainKeys Identified Mail (DKIM) Signatures", STD 76, RFC 6376, DOI 10.17487/RFC6376, September 2011,<http://www.rfc-editor.org/info/rfc6376>. ๐[RFC6377]Kucherawy, M., "DomainKeys Identified Mail (DKIM) and Mailing Lists", BCP 167, RFC 6377, DOI 10.17487/RFC6377, September 2011,<http://www.rfc-editor.org/info/rfc6377>. ๐[RFC6648]Saint-Andre, P., Crocker, D., and M. Nottingham, "Deprecating the "X-" Prefix and Similar Constructs in Application Protocols", BCP 178, RFC 6648, DOI 10.17487/RFC6648, June 2012,<http://www.rfc-editor.org/info/rfc6648>. ๐[RFC7208]Kitterman, S., "Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1", RFC 7208, DOI 10.17487/RFC7208, April 2014,<http://www.rfc-editor.org/info/rfc7208>. ๐[RFC7372]Kucherawy, M., "Email Authentication Status Codes", RFC 7372, DOI 10.17487/RFC7372, September 2014,<http://www.rfc-editor.org/info/rfc7372>. ๐
6.2. Informative References
[RFC7489]Kucherawy, M., Ed. and E. Zwicky, Ed., "Domain-based Message Authentication, Reporting, and Conformance (DMARC)", RFC 7489, DOI 10.17487/RFC7489, March 2015,<http://www.rfc-editor.org/info/rfc7489>. ๐[RFC7601]Kucherawy, M., "Message Header Field for Indicating Message Authentication Status", RFC 7601, DOI 10.17487/RFC7601, August 2015,<http://www.rfc-editor.org/info/rfc7601>. ๐
Appendix A. Example SPF Bounce โจ
Okay so this appendix is a little showcase of a notification message, aka a "bounce" ๐ Let's see how it plays out!
A.1. Initial Message
Here's the message right as it leaves the Origin MTA (segv.d1.example):
Return-Path: <jqd@d1.example>
Received: from [10.10.10.131] (w-x-y-z.dsl.static.isp.com [w.x.y.z])
(authenticated bits=0)
by segv.d1.example with ESMTP id t0FN4a8O084569;
Thu, 14 Jan 2015 15:00:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d1.example;
s=20130426; t=1421363082;
bh=EoJqaaRvhrngQxmQ3VnRIIMRBgecuKf1pdkxtfGyWaU=;
h=Message-ID:Date:From:MIME-Version:To:CC:Subject:Content-Type:
Content-Transfer-Encoding;
b=HxsvPubDE+R96v9dM9Y7V3dJUXvajd6rvF5ec5BPe/vpVBRJnD4I2weEIyYijrvQw
bv9uUA1t94kMN0Q+haFo6hiQPnkuDxku5+oxyZWOqtNH7CTMgcBWWTp4QD4Gd3TRJl
gotsX4RkbNcUhlfnoQ0p+CywWjieI8aR6eof6WDQ=
Message-ID: <54B84785.1060301@d1.example>
Date: Thu, 14 Jan 2015 15:00:01 -0800
From: John Q Doe <jqd@d1.example>
To: no-recipient@dmarc.org
Subject: Example 1
Hey gang,
This is a test message.
--J.
A.2. Notification Message
So here's the drama ๐ญ When dmarc.org rejects the message without a DKIM signature, it sets the RFC5321.HELO/.EHLO domain to dmarc.org.local, which has no SPF record. dmarc.org has a reject policy in place for these non-passing cases. There's no DKIM signature on the notification message either, so the failed SPF lookup ends up as dmarc=fail, and d1.example could be expected to discard the notification message itself. Iconic, right? ๐
Return-Path: <>
Received: from dmarc.org.local (mail.dmarc.org. [192.0.2.1])
by mx.d1.example with ESMTPS id Lkm25302jJR5
for <jqd@d1.example>
(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 14 Jan 2015 15:00:24 -0800 (PST)
Authentication-Results: mx.d1.example;
spf=none (d1.example: dmarc.org.local does not designate
permitted sender hosts) smtp.mail=;
dmarc=fail (p=REJECT dis=NONE) header.from=dmarc.org
MIME-Version: 1.0
Received: from segv.d1.example (segv.d1.example [198.51.100.1])
by 192.0.2.2 with SMTP id u67mr102828634qge33; Thu,
14 Jan 2015 15:00:24 -0800 (PST)
From: Mail Delivery Subsystem <mailer-daemon@dmarc.org>
To: jqd@d1.example
Subject: Delivery Status Notification (Failure)
Message-ID: <001a11c16e6a9ead220528df294a@dmarc.org>
Date: Thu, 14 Jan 2016 23:00:24 +0000
Content-Type: text/plain; charset=UTF-8
This is an automatically generated Delivery Status Notification
Delivery to the following recipient failed permanently:
no-recipient@dmarc.org
Technical details of permanent failure:
Your message was rejected by the server for the recipient domain
dmarc.org by mail.dmarc.org [192.0.2.1].
The error that the other server returned was:
550 5.1.1 <no-recipient@dmarc.org>... User unknown
----- Original message -----
Return-Path: <jqd@d1.example>
Received: from [203.252.0.131] (131-0-252-203-dsl.static.example.com
[203.252.0.131]) (authenticated bits=0)
by segv.d1.example with ESMTP id t0FN4a8O084569;
Thu, 14 Jan 2015 15:00:01 -0800 (PST)
(envelope-from jqd@d1.example)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=d1.example;
s=20130426; t=1421363082;
bh=EoJqaaRvhrngQxmQ3VnRIIMRBgecuKf1pdkxtfGyWaU=;
h=Message-ID:Date:From:MIME-Version:To:CC:Subject:Content-Type:
Content-Transfer-Encoding;
b=HxsvPubDE+R96v9dM9Y7V3dJUXvajd6rvF5ec5BPe/vpVBRJnD4I2weEIyYijrvQw
bv9uUA1t94kMN0Q+haFo6hiQPnkuDxku5+oxyZWOqtNH7CTMgcBWWTp4QD4Gd3TRJl
gotsX4RkbNcUhlfnoQ0p+CywWjieI8aR6eof6WDQ=
Message-ID: <54B84785.1060301@d1.example>
Date: Thu, 14 Jan 2015 15:00:01 -0800
From: John Q Doe <jqd@d1.example>
To: no-recipient@dmarc.org
Subject: Example 1
Hey gang,
This is a test message.
--J.
Acknowledgments ๐ซถ
Huge thanks to Miles Fidelman, John Levine, David Crocker, Stephen J. Turnbull, Rolf E. Sonneveld, Tim Draegen, and Franck Martin, who all contributed to the IETF DMARC Working Group's wiki page listing every known interoperability issue with DMARC and indirect email flows. Legends. ๐ธ
Tim Draegen then turned the first draft of this document out of those contributions, ham-fistedly mapping them into the language of [RFC5598] ๐
Authors' Addresses ๐
Franck Martin (editor)
LinkedIn
Mountain View, CA
United States of America
Email: fmartin@linkedin.com
Eliot Lear (editor)
Cisco Systems GmbH
Richtistrasse 7
Wallisellen, ZH CH-8304
Switzerland
Phone: +41 44 878 9200
Email: lear@cisco.com
Tim Draegen (editor)
dmarcian, inc.
PO Box 1007
Brevard, NC 28712
United States of America
Email: tim@dmarcian.com
Elizabeth Zwicky (editor)
Yahoo
Sunnyvale, CA
United States of America
Email: zwicky@yahoo-inc.com
Kurt Andersen (editor)
LinkedIn
2029 Stierlin Court
Mountain View, CA 94043
United States of America
Email: kandersen@linkedin.com
๐ฆ where this page comes from
- ietf: rfc7960 2016-09
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms