<?xml version="1.0" encoding="utf-8"?>
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  docName="draft-simsnet-mail-headers-00"
  ipr="trust200902"
  category="std"
  consensus="true"
  xml:lang="en"
  submissionType="IETF"
  version="3">

  <front>
    <title abbrev="Mail Origin Headers">The "HeaderWrittenBy" and "SendingSoftware" Mail Header Fields</title>

    <seriesInfo name="Internet-Draft" value="draft-simsnet-mail-headers-00"/>

    <author initials="J." surname="Sims" fullname="Jim Sims">
      <organization>SIMS.NET Inc</organization>
      <address>
        <postal>
          <street>12842 Highland Hills Drive</street>
          <city>Cypress</city>
          <region>TX</region>
          <code>77429</code>
          <country>US</country>
        </postal>
        <email>jim@sims.net</email>
      </address>
    </author>

    <date day="11" month="December" year="2025"/>

    <area>Applications</area>

    <abstract>
      <t>This document proposes two new, optional mail header fields.</t>
      <ul>
        <li><t>"HeaderWrittenBy" is designed to provide a simple attestation of the host that injected a message's primary author-level headers (such as "From") into the mail system.</t></li>
        <li><t>"SendingSoftware" is designed to declare the Mail User Agent (MUA) that composed the message.</t></li>
      </ul>
      <t>These are intended to provide additional, simple-to-parse signals for mail filtering and analysis, to be used in conjunction with existing authentication mechanisms like DKIM.</t>
    </abstract>
  </front>

  <middle>
    <section>
      <name>Introduction</name>
      <t>In modern email, the author-level header fields, such as From and Reply-To, are trivial to forge. This forgery is a cornerstone of phishing and spam. While a message's transport path is documented in Received headers, parsing these headers is notoriously complex and error-prone.</t>

      <t>This proposal introduces two simpler, non-cryptographic headers.</t>
      <ul>
        <li><t>The <tt>SendingSoftware</tt> header is added by the Mail User Agent (MUA) to identify itself (e.g., "Outlook 16.0").</t></li>
        <li><t>The <tt>HeaderWrittenBy</tt> header is added by the Mail Submission Agent (MSA) that first receives the message.</t></li>
      </ul>
      <t>These headers provide clear signals that can be compared against other headers for discrepancies. Their primary utility is realized when they are included in a message's cryptographic signature, such as DKIM <xref target="RFC6376"/>.</t>
    </section>

    <section>
      <name>Terminology</name>
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 <xref target="RFC2119"/>.</t>

      <dl>
        <dt>MUA (Mail User Agent):</dt>
        <dd>A program (e.g., a desktop client or webmail interface) used to compose and read email.</dd>
        <dt>MSA (Mail Submission Agent):</dt>
        <dd>A server that receives mail from an MUA and cooperates with Mail Transfer Agents (MTAs) to deliver the mail. This is the first point of entry into the mail transport system.</dd>
        <dt>MTA (Mail Transfer Agent):</dt>
        <dd>A server that relays mail between other servers.</dd>
      </dl>
    </section>

    <section>
      <name>Header Field Specifications</name>

      <section anchor="HeaderWrittenBySyntax">
        <name>"HeaderWrittenBy" Syntax</name>
        <t>The <tt>HeaderWrittenBy</tt> header field is added to a message's header section as defined in RFC 5322 <xref target="RFC5322"/>.</t>
        <t>The syntax, in ABNF <xref target="RFC5234"/>, is as follows:</t>
        <sourcecode name="ABNF">
HeaderWrittenBy = "HeaderWrittenBy:" FWS hostname FWS
hostname = (ALPHA / DIGIT) *( *("-" (ALPHA / DIGIT)) )
FWS (Folding White Space) is defined in [RFC5322].
        </sourcecode>
        <t>The <tt>hostname</tt> value SHOULD be the fully qualified domain name (FQDN) of the MSA that adds the header. If an FQDN is not available, a literal IP address (IPv4 or IPv6) MAY be used, enclosed in brackets (e.g., <tt>[192.0.2.1]</tt> or <tt>[ipv6:2001:db8::1]</tt>).</t>
      </section>

      <section anchor="HeaderWrittenBySemantics">
        <name>"HeaderWrittenBy" Semantics</name>
        <t>The <tt>HeaderWrittenBy</tt> field provides a simplified trace of the message's origin.</t>
        <t>An MUA MUST NOT add this header field. An MSA that receives a message from an MUA (i.e., its first injection into the mail system) SHOULD add exactly one <tt>HeaderWrittenBy</tt> header field. The value of the hostname component MUST be the verified identity of the MSA itself.</t>
        <t>If an MTA receives a message from another host (not an MUA) that already contains a <tt>HeaderWrittenBy</tt> header, this indicates a potential header forgery attempt or a non-compliant relay. The receiving MTA SHOULD prepend its own <tt>HeaderWrittenBy</tt> header.</t>
        <t>The presence of multiple <tt>HeaderWrittenBy</tt> headers is a strong signal for spam filtering. A legitimate message, handled by compliant servers, should only have one such header.</t>
      </section>

      <section anchor="SendingSoftwareSyntax">
        <name>"SendingSoftware" Syntax</name>
        <t>The <tt>SendingSoftware</tt> header field's syntax is as follows:</t>
        <sourcecode name="ABNF">
SendingSoftware = "SendingSoftware:" FWS unstructured FWS
        </sourcecode>
        <t><tt>unstructured</tt> is defined in <xref target="RFC5322"/> and allows for free-form text (e.g., "Outlook 16.0.1", "Apple Mail (2.345.1)").</t>
      </section>

      <section anchor="SendingSoftwareSemantics">
        <name>"SendingSoftware" Semantics</name>
        <t>The <tt>SendingSoftware</tt> field indicates the name and version of the MUA used to compose the message.</t>
        <t>An MUA SHOULD add exactly one <tt>SendingSoftware</tt> header field to a message upon composition. This header field is analogous to the non-standard <tt>User-Agent</tt> or <tt>X-Mailer</tt> headers. This document proposes standardizing it.</t>
      </section>
    </section>

    <section>
      <name>Operational Considerations</name>

      <section anchor="example1">
        <name>Example 1: Legitimate Mail ("Good Actor")</name>
        <t>A compliant MUA (e.g., Outlook) adds the <tt>SendingSoftware</tt> header. The user submits the message to their MSA (e.g., <tt>smtp.provider.com</tt>). The MSA, receiving the message from an MUA and seeing no <tt>HeaderWrittenBy</tt> header, adds one.</t>
        <t>Final Headers (in part):</t>
        <sourcecode name="Mail Headers">
SendingSoftware: Outlook (16.0.7716.1000)
HeaderWrittenBy: smtp.provider.com
Received: from [192.0.2.100] (helo=desktop-client) ...
From: "Example User" user@example.com
To: "Recipient" recipient@other.com
Subject: Example Message
        </sourcecode>
        <t>A receiving filter sees one <tt>HeaderWrittenBy</tt> header and can compare <tt>example.com</tt> and <tt>smtp.provider.com</tt> for analysis.</t>
      </section>

      <section anchor="example2">
        <name>Example 2: Forged Mail ("Bad Actor")</name>
        <t>A spammer on a compromised host (<tt>spammer-host.com</tt>) crafts a message with forged headers and sends it to an open relay (<tt>random-email-host.com</tt>).</t>
        <t>Spammer's Injected Headers:</t>
        <sourcecode name="Forged Headers">
HeaderWrittenBy: mail.chase.com (FORGED)
SendingSoftware: Microsoft Outlook (FORGED)
From: "Chase Bank" security@chase.com
        </sourcecode>
        <t>The server <tt>random-email-host.com</tt> receives this. It is not receiving from an MUA, and it sees an existing <tt>HeaderWrittenBy</tt> header. Per <xref target="HeaderWrittenBySemantics"/>, it prepends its own header.</t>
        <t>Final Headers at Recipient (in part):</t>
        <sourcecode name="Mail Headers">
HeaderWrittenBy: random-email-host.com (Added by relay)
Received: from spammer-host.com (HELO mail.chase.com) ...
HeaderWrittenBy: mail.chase.com (FORGED by spammer)
SendingSoftware: Microsoft Outlook (FORGED by spammer)
From: "Chase Bank" security@chase.com
        </sourcecode>
        <t>Analysis: A receiving filter sees this and immediately knows it is spam for two reasons:</t>
        <ol>
            <li><t>There are multiple <tt>HeaderWrittenBy</tt> headers.</t></li>
            <li><t>The topmost <tt>HeaderWrittenBy</tt> header (<tt>random-email-host.com</tt>) does not match the From domain (<tt>chase.com</tt>).</t></li>
        </ol>
      </section>
    </section>

    <section>
      <name>Security Considerations</name>
      <t>This proposal, by itself, does not solve header forgery, but provides a mechanism to contain and identify it.</t>
      <t>Forgery of Headers: <tt>SendingSoftware</tt> is trivially forged. <tt>HeaderWrittenBy</tt> is also trivially forged by the original sender. However, this proposal is designed to neutralize that forgery. A compliant MTA that receives a message with a pre-existing (forged) <tt>HeaderWrittenBy</tt> header will prepend its own, creating a stack. This stack is a strong indicator of an untrusted message and exposes the non-compliant relay (<tt>random-email-host.com</tt>).</t>
      <t>Relationship to SPF <xref target="RFC7208"/>, DKIM, and DMARC <xref target="RFC7489"/>: These headers are not a replacement for modern cryptographic authentication methods. They provide supplementary signals. It is STRONGLY RECOMMENDED that any MSA that adds a <tt>HeaderWrittenBy</tt> header also includes this header in the list of headers protected by its DKIM <xref target="RFC6376"/> signature. In a legitimate message (<xref target="example1"/>), this provides a cryptographically-backed attestation of the injection host.</t>
    </section>

    <section>
      <name>IANA Considerations</name>
      <t>This document requests IANA to register the following header fields in the "Permanent Message Header Field Registry" <xref target="RFC3864"/>:</t>
      <dl newline="true">
        <dt>Header field name:</dt>
        <dd><tt>HeaderWrittenBy</tt></dd>
        <dt>Applicable protocol:</dt>
        <dd>mail</dd>
        <dt>Status:</dt>
        <dd>optional</dd>
        <dt>Author/Change controller:</dt>
        <dd>IETF</dd>
        <dt>Specification document(s):</dt>
        <dd>[This document]</dd>
      </dl>
      <dl newline="true">
        <dt>Header field name:</dt>
        <dd><tt>SendingSoftware</tt></dd>
        <dt>Applicable protocol:</dt>
        <dd>mail</dd>
        <dt>Status:</dt>
        <dd>optional</dd>
        <dt>Author/Change controller:</dt>
        <dd>IETF</dd>
        <dt>Specification document(s):</dt>
        <dd>[This document]</dd>
      </dl>
    </section>
  </middle>

  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author initials="S." surname="Bradner" fullname="S. Bradner"/>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234">
        <front>
          <title>Augmented BNF for Syntax Specifications: ABNF</title>
          <author initials="D." surname="Crocker" fullname="D. Crocker" role="editor"/>
          <author initials="P." surname="Overell" fullname="P. Overell"/>
          <date month="January" year="2008"/>
        </front>
        <seriesInfo name="STD" value="68"/>
        <seriesInfo name="RFC" value="5234"/>
        <seriesInfo name="DOI" value="10.17487/RFC5234"/>
      </reference>
      <reference anchor="RFC5322" target="https://www.rfc-editor.org/info/rfc5322">
        <front>
          <title>Internet Message Format</title>
          <author initials="P." surname="Resnick" fullname="P. Resnick" role="editor"/>
          <date month="October" year="2008"/>
        </front>
        <seriesInfo name="RFC" value="5322"/>
        <seriesInfo name="DOI" value="10.17487/RFC5322"/>
      </reference>
    </references>
    <references>
      <name>Informative References</name>
      <reference anchor="RFC3864" target="https://www.rfc-editor.org/info/rfc3864">
        <front>
          <title>Registration Procedures for Message Header Fields</title>
          <author initials="G." surname="Klyne" fullname="G. Klyne"/>
          <date month="September" year="2004"/>
        </front>
        <seriesInfo name="BCP" value="90"/>
        <seriesInfo name="RFC" value="3864"/>
        <seriesInfo name="DOI" value="10.17487/RFC3864"/>
      </reference>
      <reference anchor="RFC6376" target="https://www.rfc-editor.org/info/rfc6376">
        <front>
          <title>DomainKeys Identified Mail (DKIM) Signatures</title>
          <author initials="D." surname="Crocker" fullname="D. Crocker" role="editor"/>
          <date month="September" year="2011"/>
        </front>
        <seriesInfo name="STD" value="76"/>
        <seriesInfo name="RFC" value="6376"/>
        <seriesInfo name="DOI" value="10.17487/RFC6376"/>
      </reference>
      <reference anchor="RFC7208" target="https://www.rfc-editor.org/info/rfc7208">
        <front>
          <title>Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, Version 1</title>
          <author initials="S." surname="Kitterman" fullname="S. Kitterman"/>
          <date month="April" year="2014"/>
        </front>
        <seriesInfo name="RFC" value="7208"/>
        <seriesInfo name="DOI" value="10.17487/RFC7208"/>
      </reference>
      <reference anchor="RFC7489" target="https://www.rfc-editor.org/info/rfc7489">
        <front>
          <title>Domain-based Message Authentication, Reporting, and Conformance (DMARC)</title>
          <author initials="M." surname="Kucherawy" fullname="M. Kucherawy" role="editor"/>
          <author initials="E." surname="Zwicky" fullname="E. Zwicky" role="editor"/>
          <date month="March" year="2015"/>
        </front>
        <seriesInfo name="RFC" value="7489"/>
        <seriesInfo name="DOI" value="10.17487/RFC7489"/>
      </reference>
    </references>
  </back>
</rfc>