<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>

<?rfc strict='yes'?>
<?rfc toc='yes'?>
<?rfc symrefs='yes'?>
<?rfc sortrefs='yes'?>
<?rfc compact='yes'?>

<rfc category="std" ipr="full3667" docName="draft-malamud-keyword-discovery-02">
<front>
<title abbrev="No-Solicit Discovery">Attaching Meaning to Solicitation Class Keywords</title>

<author initials='C.' surname='Malamud' fullname='Carl Malamud' >
<organization>Memory Palace Press</organization>
<address>
<postal>
<street>PO Box 300</street>
<city>Sixes</city> <region>OR</region><code>97476</code>
<country>US</country>
</postal>
<email>carl@media.org</email>
</address>
</author>
<date month='February' day="19" year='2005'/>
<abstract>
<t>This Internet-Draft proposes a mechanism for finding information about
solicitation class keywords which are defined in RFC 3865, the No Soliciting
SMTP Service Extension.  The mechanism
uses a DNS NAPTR Resource Record to associate a URI with a solicitation
class keyword.  
</t>
</abstract>
<note title="Terminology">
<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 BCP 14, 
<xref target="RFC2119" />.
</t>
</note>
</front>

<middle>
<section title="Solicitation Class Keywords">
<t><xref target="RFC3865" /> defines the concept of a "solicitation class keyword",
which is an arbitrary string or label which can be associated with an electronic mail
message and transported by the ESMTP mail service as defined in <xref target="RFC2821" />
and related documents.  Solicitation class keywords are formatted like domain names,
but reversed.  
For example, the registrant of 
<spanx style="verb">example.com</spanx> might specify a particular solicitation class
keyword such as <spanx style="verb">com.example.adv</spanx> that could be inserted in 
a <spanx style="verb">No-Solicit:</spanx> header or in a trace field.
<xref target="RFC3865" /> explicitly placed discovery of the meaning of a
solicitation class keywords as outside of the scope of the basic ESMTP service
extension.</t>
<t>If that standard becomes widely deployed, a  mail message might contain a 
large number of solicitation class keywords.  The
<spanx style="verb">No-Solicit:</spanx> header has keywords inserted by the sender of
the message, which might include the sender's own keywords, as well as those
mandated by regulatory authorities or recommended by voluntary industry associations.
Likewise, the <spanx style="verb">received:</spanx> trace fields might contain
a large number of keywords produced by message transfer agents (MTAs), filtering
software, forwarding software in the message user agent (MUA), or any other
system in the chain of delivery.</t>
<t>As the number of keywords employed grows, it will be important to find a
method for discovering the meaning behind the various labels.  This draft
specifies such a mechanism using the DNS NAPTR Resource Record, which is
defined in <xref target="RFC3403" />.  An explicit design goal is to keep
the system as simple as possible.  Approaches such as defining an XML-based
structure that would contain keyword meta-data or other approaches that
define the format of the explanation were ruled out.  Instead, the goal is
to associate a solicitation class keyword with a URI, which in turn contains
an explanation of the keyword.  
</t>
</section>
<section anchor="theapp" title="The No-Solicit NAPTR Application">
<t>
The DDDS framework of <xref target="RFC3401" /> and related documents
provides a powerful set of mechanisms that can yield sophisticated 
applications such as ENUM.<xref target="RFC3761" />
There is a simplification of the DDDS framework called the
Straightforward-NAPTR (S-NAPTR) application <xref target="RFC3958" />.
Unfortunately, S-NAPTR does not permit the use of the "U" flag for
terminal lookups and does not support the regular expression field
of the NAPTR RR.  Since a replacement field in a NAPTR record must
contain only a domain name, and our goal is to find a URI, this
draft does not use the S-NAPTR mechanism.
</t>
<t>
This draft uses the NAPTR RR to do a single lookup from solicitation class
keyword to URI.  The fields of the NAPTR RR are used as follows:
<list style="symbols">
<t>The <spanx style="verb">ORDER</spanx> and <spanx style="verb">PREFERENCE</spanx> fields are to be processed as specified
in <xref target="RFC3403" />: if multiple records are returned,
the one(s) with the lowest <spanx style="verb">ORDER</spanx> value that have a matching <spanx style="verb">SERVICE</spanx>
field MUST be used.  Of those with the lowest ORDER value, those
with the lowest <spanx style="verb">PREFERENCE</spanx> SHOULD be used.</t>
<t>The <spanx style="verb">FLAGS</spanx> field MUST contain the character "U".</t>
<t>The <spanx style="verb">SERVICES</spanx> field MUST contain only the string "no-solicit".
</t>
<t>The <spanx style="verb">REGEXP</spanx> field MUST contain a valid URI as further specified in this
section.</t>
<t>The <spanx style="verb">REPLACEMENT</spanx> field MUST be empty.
</t>
</list></t>
<t>The <spanx style="verb">REGEXP</spanx> field is defined in <xref target="RFC3402" /> as consisting
of a <spanx style="verb">delim-character</spanx>, a POSIX Extended Regular Expression, another
<spanx style="verb">delim-character</spanx>, a replacement value, and a final 
<spanx style="verb">delim-character</spanx>.  For
this application the following rules apply:
<list style="symbols">
<t>The <spanx style="verb">delim-character</spanx> MAY be any valid character as defined in
section 3.2 of <xref target="RFC3402" />.</t>
<t>The extended regular expression MUST be empty.</t>
<t>The replacement value 
MUST contain a valid URI as specified in
<xref target="RFC2396" />.</t>
<t>The replacement value SHOULD contain
a URI limited to the "ftp", "http", and "https" schemes as
specified in <xref target="RFC2396" /> and <xref target="RFC2660" />.
</t>
<t>The document that is retrieved at the URI SHOULD 
conform to <xref target="W3C.REC-html401-19991224" />,
including the Accessibility Guidelines contained therein.</t>
</list></t>
</section>
    <section title='Example(Non-Normative)'>
      <t>A set of NAPTR records have been installed in the
        <spanx style='verb'>simians.net</spanx> subdomain and can be 
retrieved using
        <spanx style='verb'>dig</spanx> or
other DNS utilities:

      </t>
      <figure>
        <artwork>
[carl@example.com]% dig 2795.simians.net naptr

; &lt;&lt;&gt;&gt; DiG 9.2.3 &lt;&lt;&gt;&gt; 2795.simians.net naptr
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, 
   status: NOERROR, id: 43494
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 5, 
   AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;2795.simians.net.              IN      NAPTR

;; ANSWER SECTION:
2795.simians.net.       86400   IN      
     NAPTR   1 1 "U" "iam+invalid" 
     "!!http://invalid.simians.net/contact.html!" .
2795.simians.net.       86400   IN      
     NAPTR   1 1 "U" "sip+invalid" 
     "!!http://invalid.simians.net/contact.html!" .
2795.simians.net.       86400   IN      
     NAPTR   1 2 "U" "no-solicit" 
     "!!http://infinite.simians.net/keywordinfo.html!" .
2795.simians.net.       86400   IN      
     NAPTR   2 1 "U" "no-solicit" 
     "!!http://infinite.simians.net/keywordinfo.html!" .
2795.simians.net.       86400   IN      
     NAPTR   1 1 "U" "no-solicit" 
     "!!http://infinite.simians.net/keywordinfo.html!" .
</artwork>
      </figure>
      <t>A simple utility written in PERL accepts a lookup key and
returns a URL using the specifications in this document:
</t>
      <figure>
        <artwork>
#!/usr/bin/perl
# This program accepts a solicitation class keyword and 
# returns a URL on success.  It dies quietly on failure.
use strict;

# http://www.net-dns.org/
use Net::DNS;

# reverse the label to create a domain name
my $target = join( ".", reverse( split( /\./, $ARGV[0]) ) );

# create a resolver
my $res = Net::DNS::Resolver-&gt;new;

# find all naptr records
my $query = $res-&gt;query( "$target", "NAPTR" ) || exit ;

# Do your DNSSEC checks here, throw away all invalid RRs

# get the answers, strip out non-matching services,
# sort by order, preference
my @rr =
  sort {
    # sort records numerically by order, preference
    $a-&gt;order &lt;=&gt; $b-&gt;order
      || $a-&gt;preference &lt;=&gt; $b-&gt;preference
  }
  grep { $_-&gt;service =~ /no-solicit/ } $query-&gt;answer;

# print the first qualifying record, strip out the 
# regexp markers
my $op = substr( my $answer = $rr[0]-&gt;regexp , 0, 1 ) 
   || exit ;
print split ( $op, $answer ) ; exit ;
</artwork>
      </figure>
      <t>
Running the code gives the 
following results:
</t>
      <figure>
        <artwork>
[carl@example.com]% lynx -source `./discover.pl net.simians.2795`
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;About Our Solicitation Class Keyword&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt; 
    &lt;center&gt;
      &lt;a href="monkey.mp3"&gt;
        &lt;img alt="bouncy monkey logo" 
             src="images/monkey_fpo.gif" border="0" /&gt;
        &lt;br /&gt;
       &lt;/a&gt;
       &lt;br /&gt;
       About net.simians.2795:&lt;br /&gt;
       It has been determined that the content of this 
       mail message&lt;br /&gt;
       conforms to the spirit of RFC 2795.  
       Congratulations?
    &lt;/center&gt;
  &lt;/body&gt;
&lt;/html&gt;
</artwork>
      </figure>
    </section>
<section title="DDDS Application Specification">
<t>The following definitions apply to this application:
<list style="symbols">
<t>Application Unique String: The application unique string
is a Solicitation Class Keyword as defined in <xref target="RFC3865" />.</t>
<t>First Well Known Rule: The Solicitation Class Keyword is reversed
in order to produce a valid domain name.  For example, 
<spanx style="verb">com.example.adv</spanx> would become
<spanx style="verb">adv.example.com</spanx>.</t>
<t>Valid Databases: The DNS <spanx style="emph">is</spanx> the database.</t>
<t>Expected Output: A URI.</t>
<t>The <spanx style="verb">SERVICE</spanx> field MUST contain the string "no-solicit", the
<spanx style="verb">FLAGS</spanx> field MUST contain the string "U", the <spanx style="verb">REPLACEMENT</spanx> field
MUST be empty, and the <spanx style="verb">REGEXP</spanx> field MUST be formatted as specified
in <xref target="theapp" />.</t>
</list></t>
<t>Wildcards are appropriate for this application, allowing multiple
solicitation class keywords that share a common prefix to all point
to the same URI.</t>
</section>
<section title="Acknowledgments">
<t>The author would like to thank the following for their helpful suggestions
and reviews of this draft: Leslie Daigle, Arnt Gulbrandsen, Scott Hollenbeck, Michael
Mealling, and Ted Hardie.</t>
</section>
<section title="Security Considerations">
<t>Use of a URI with the <spanx style="verb">https:</spanx> scheme without
the use of DNSSEC 
makes an unwarranted illusion of authenticity and the possibility 
of active attacks a serious concern.
</t>
</section>
<section title="IANA Considerations">
<t>
There does not appear to be a central registry maintained
by the IANA of values that might appear in a <spanx style="verb">SERVICE</spanx> field
of a NAPTR resource record.  Thus, no direct IANA actions are
required.</t>
<t>
However, the IANA does maintain an 
Application Service Tag Registry, which is used to support the
S-NAPTR DDDS application defined in <xref target="RFC3958" />.
The IANA is advised that the "no-solicit" value for the
<spanx style="VERB">SERVICE</spanx> field is in use per
this draft and thus should not be used in the Application
Service Tag Registry for other applications.</t>
</section>
</middle>
<back>
<references title="Normative References">
<?rfc include="reference.RFC.3958"?>
<?rfc include="reference.RFC.2660"?>
<?rfc include="reference.RFC.3402"?>
<?rfc include="reference.RFC.3403"?>
<?rfc include="reference.RFC.3865"?>
<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.2396"?>
<?rfc include="reference.W3C.REC-html401-19991224"?>
</references>
<references title="Informative References">
<?rfc include="reference.RFC.2795"?>
<?rfc include="reference.RFC.3401"?>
<?rfc include="reference.RFC.3761"?>
<?rfc include="reference.RFC.2821"?>
</references>
    <section title="Intended Status and Discussion (TO BE REMOVED UPON PUBLICATION)">
    <t>This draft is being submitted as an individual
submission with an intended publication as a Proposed Standard.  Discussion
of this draft should take place on the <eref target="mailto:namedroppers@ops.ietf.org" />
mailing list (<eref target="mailto:namedroppers-request@ops.ietf.org" /> to
subscribe).  The source and alternative transformations for this
draft may be found at <eref target="http://trusted.resource.org/no-solicit/" />.
</t>

    </section>
    <section title="Changes From Previous Draft (TO BE REMOVED UPON PUBLICATION)">
<t>From draft-malamud-keyword-discovery-01 to 
draft-malamud-keyword-discovery-02:
<list style="symbols">
<t>Clarified intended publication status.</t>
</list></t>
<t>From draft-malamud-keyword-discovery-00 to 
draft-malamud-keyword-discovery-01:
<list style="symbols">
<t>Moved the example from the appendix to the main text.</t>
<t>Added a brief note on use of wildcards to the DDDS application
definition.</t>
<t>Minor re-arranging to conform to RFC Editor requirements.</t>
</list>
</t>
    </section>

  </back>
</rfc>
