<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://xml.resource.org/authoring/rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY rfc4406 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4406.xml">
  <!ENTITY rfc4407 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4407.xml">
  <!ENTITY rfc4408 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4408.xml">

  <!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
  <!ENTITY rfc5234 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml">
  <!ENTITY rfc5322 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5322.xml">
]>

<?rfc
  strict="no"
  compact="yes"
  subcompact="no"
  toc="yes"
  tocdepth="2"
  symrefs="yes"
?>

<rfc
  category="std"
  ipr="trust200902"
  docName="draft-mehnle-spf-scope-00"
>
  <front>
    <title abbrev='Extended Scopes for SPF'>
      "From" and other Message Header Fields as SPF Policy Scopes
    </title>

    <author fullname="Julian Mehnle" initials="J." surname="Mehnle">
      <organization abbrev="Authentication Metrics">
        Authentication Metrics, Inc.
      </organization>
      <address>
        <email>jmehnle@authmetrics.com</email>
      </address>
    </author>

    <date/>

    <abstract>
      <t>
        This document defines a new modifier for the SPF e-mail authentication protocol allowing the SPF record for a domain to be declared as being applicable to message identities other than the MAIL FROM identity, such as the "From" or "Sender" message header identities.
      </t>
    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>
        <xref target="RFC4408">Sender Policy Framework (SPF)</xref> was designed to prevent the unauthorized use of domain names in the reverse-path of e-mail messages (also known as the envelope sender or MAIL FROM identity).  However, the reverse-path is used purely for message transport purposes and in practice is never exposed to the end user, so SPF cannot protect against typical forms of address spoofing targeting user visible identities such as the "From" message header field.
      </t>
      <t>
        <xref target="RFC4406">Sender ID</xref> was designed to overcome this limitation of SPF by defining an artificial identity named <xref target="RFC4407">Purported Responsible Address (PRA)</xref> based on one of the <xref target="RFC5322">"From", "Sender", "Resent-From", and "Resent-Sender" message header fields</xref>.  The algorithm underlying the PRA definition was intended to select the identity representing the entity responsible for the message's most recent injection into the mail system.  The "Resent-From" and "Resent-Sender" fields, however, too, are rarely exposed to the end user, so by taking these into consideration PRA-based Sender ID policies open themselves up to attacks where the "From" header address is spoofed and a "Resent-From" or "Resent-Sender" field is added — typically invisible to the end user — with an unrelated (usually unprotected) address.
      </t>
      <t>
        This document defines a new "scope" modifier, as provided by Section 6 of <xref target="RFC4408"/>, for use in SPF "v=spf1" policies.  Policies that include a "scope" modifier may be used to authenticate message identities other than the HELO or MAIL FROM identities defined by <xref target="RFC4408"/>, such as the "From" or "Sender" message header identities.
      </t>

      <section title="Conventions Used in This Document">
        <section title="Requirements Notation">
          <t>
            This document occasionally uses terms that appear in capital letters.  When the terms "MUST", "SHOULD", "RECOMMENDED", "MUST NOT", "SHOULD NOT", and "MAY" appear capitalized, they are being used to indicate particular requirements of this specification.  A discussion of the meanings of these terms appears in <xref target="RFC2119"/>.
          </t>
        </section>

        <section title="Syntactic Notation">
          <t>
            This specification uses the <xref target="RFC5234">Augmented Backus-Naur Form (ABNF)</xref> notation for formal syntax definitions.  Characters will be specified either by a decimal value (e.g., the value %d65 for uppercase A and %d97 for lowercase A) or by a case-insensitive literal value enclosed in quotation marks (e.g., "A" for either uppercase or lowercase A).
          </t>
        </section>
      </section>
    </section>

    <section title="Supported Message Identities">
      <t>
        The "scope" modifier allows a domain owner to specify a set of message identities to which a domain's SPF policy may be applied in addition to the default HELO and MAIL FROM identities to which all "v=spf1" policies may be applied.  This section defines the identities that may be specified as part of a "scope" modifier.  Other documents may define additional identities.
      </t>

      <section anchor="hdr-from" title='The "From" Header Identity'>
        <t>
          Per Section 3.6.2 of <xref target="RFC5322"/> a typical e-mail message includes a single "From" header field containing a single mailbox specification indicating the mailbox of the person or system responsible for authoring the message.  The addr-spec part (Section 3.4 of <xref target="RFC5322"/>) of that mailbox constitutes the "From" header identity of such a message.
        </t>
        <t>
          A message's "From" header field may contain more than one mailbox specification if the message was authored by multiple persons.  Such a message has multiple "From" header identities.
        </t>
        <t>
          A message with zero "From" header fields is invalid per <xref target="RFC5322"/>.  Such a messages has no "From" header identity.
        </t>
        <t>
          A message with more than one "From" header field is invalid per <xref target="RFC5322"/>, however in order to prevent the display or other use of unintentionally unauthenticated identities from such a message it is RECOMMENDED that in this case implementations of this specification treat all the mailbox specifications in all the "From" header fields as multiple "From" header identities for the purposes of this document.
        </t>
      </section>

      <section anchor="hdr-sender" title='The "Sender" Header Identity'>
        <t>
          Per Section 3.6.2 of <xref target="RFC5322"/> an e-mail message may include a single "Sender" header field containing a single mailbox specification indicating the mailbox of the person or system responsible for originally sending the message.  The addr-spec part (Section 3.4 of <xref target="RFC5322"/>) of that mailbox constitutes the "Sender" header identity of such a message.
        </t>
        <t>
          A message with zero "Sender" header fields is assumed to have been sent by its author, as specified by a single "From" header field with a single mailbox specification.  Such a message's "Sender" header identity is its "From" header identity.
        </t>
        <t>
          A message with zero "Sender" header fields and multiple "From" header identities (as multiple mailbox specifications in a single or in multiple "From" header field(s)) is invalid per <xref target="RFC5322"/>, however in order to prevent the display or other use of unintentionally unauthenticated identities from such a message it is RECOMMENDED that in this case implementations treat multiple "From" header identities as multiple "Sender" header identities for the purposes of this document.
        </t>
        <t>
          A message with a single "Sender" header field containing multiple mailbox specifications or with more than one "Sender" header field is invalid per <xref target="RFC5322"/>, however it is RECOMMENDED that in this case implementations treat all the mailbox specifications in all the "Sender" header fields as multiple "Sender" header identities for the purposes of this document.
        </t>
      </section>

      <!-- TODO: PRA? -->
    </section>

    <section title='The "scope" modifier'>
      <section title="Syntax">
        <t>
          This document defines a new modifier named "scope" for use in SPF "v=spf1" policies as provided by Section 6 of <xref target="RFC4408"/>.  The grammar is as follows:
        </t>
        <figure>
          <artwork type="abnf">
     mod-scope = "scope" "=" scope-ids

     scope-ids = scope-id *( "," scope-id )

     scope-id  = "hdr-from" / "hdr-sender" / name
          </artwork>
        </figure>
        <t>
          An SPF policy may contain at most one "scope" modifier; an implementation encountering more than one "scope" modifier in a policy MUST generate a "PermError" result.  The single "scope" modifier MAY occur anywhere in the record after the initial "v=spf1", however it is RECOMMENDED that it be inserted immediately after the initial "v=spf1" to make it clear that the semantics associated with it apply to the entire policy; of course this is always the case, even if the "scope" modifier occurs in a different position.
        </t>
        <t>&lt;scope-id&gt; values are defined as follows:</t>
        <texttable>
          <ttcol align="left">Identity</ttcol>
          <ttcol align="left">Defined in</ttcol>
          <c>hdr-from</c>   <c><xref target="hdr-from"/> of this document</c>
          <c>hdr-sender</c> <c><xref target="hdr-sender"/> of this document</c>
        </texttable>
        <t>
          For example, the SPF record
        </t>
        <figure>
          <artwork>
         v=spf1 scope=hdr-from ip4:192.168.0.101 -all
          </artwork>
        </figure>
        <t>
          defines a sender policy that may be used to authenticate "From" header identities in messages.
        </t>
      </section>

      <section title="Semantics">
        <t>
          An SPF policy that includes a "scope" modifier may be used to authenticate the message identities specified as a separated list of &lt;scope-id&gt;s in the modifier value.  The set of identities listed is said to be the (extended) scope of the policy.  A supported identity is said to be "in scope" of a policy if it is listed in the policy's scope modifier.
        </t>
        <t>
          Authentication of a supported, in-scope message identity against an SPF policy is done by applying the check_host() function defined in Section 4 of <xref target="RFC4408"/>, passing the identity as the &lt;sender&gt; argument and its domain portion as the &lt;domain&gt; argument.
        </t>
        <t>
          When authenticating a certain type of identity in a given message and the message does not contain any instances of that identity, there is nothing to authenticate.
        </t>
        <t>
          When authenticating a certain type of identity in a given message and the message contains multiple distinct instances of that identity, the result of each check applies only to a single distinct instance of the identity.  It is RECOMMENDED that an implementation check all the instances of a type of identity that it chooses to authenticate.
          Then, for example, individual identity instances may be marked according to their results when displaying the message to the end user, or an aggregate result may be derived from the individual results.  The precise behavior is not defined by this document except that, for a given message, all instances of a given identity type MUST be treated according to the same rules.  Implementations MUST NOT simply select one of them as "the" identity of that type.
        </t>
        <t>
          NOTE:  The support of modifiers defined by specifications other than the base SPF specification is generally optional and domain owners should be aware that their "v=spf1" policies will be used by receivers to authenticate the default HELO and MAIL FROM identities defined by <xref target="RFC4408"/>; there is no way to prevent that.  "v=spf1" policies with a "scope" modifier published with the primary intent of allowing the authentication of non-HELO, non-MAIL-FROM identities should be constructed in such a way that legitimate messages sent with relevant HELO or MAIL FROM identities will not unexpectedly fail authentication of these identities.
        </t>
      </section>
    </section>

    <section title="Security Considerations">
      <t>Lots of headaches to be considered.</t>
<!--
      <section anchor="security_zero_or_multi_from_fields" title='Zero or Multiple "From" Header Fields'>
      </section>
-->
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc4408;
      &rfc5234;
      &rfc5322;
    </references>

    <references title="Informative References">
      &rfc4406;
      &rfc4407;
    </references>
  </back>
</rfc>

<!-- vim:set sw=2 sts=2 et wrap linebreak: -->

