home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_s_z / draft-showalter-sieve-01.txt < prev    next >
Text File  |  1997-06-26  |  48KB  |  1,510 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                       T. Showalter
  8. Internet Draft                                           Carnegie Mellon
  9. Document: draft-showalter-sieve-01.txt                         June 1997
  10. Expire in six months (12/97)
  11.  
  12.  
  13.  
  14.                     Sieve: A Mail Filtering Language
  15.  
  16.  
  17. Status of this memo
  18.  
  19.    This document is an Internet-Draft.  Internet-Drafts are working
  20.    documents of the Internet Engineering Task Force (IETF), its areas,
  21.    and its working groups.  Note that other groups may also distribute
  22.    working documents as Internet-Drafts.
  23.  
  24.    Internet-Drafts are draft documents valid for a maximum of six months
  25.    and may be updated, replaced, or obsoleted by other documents at any
  26.    time.  It is inappropriate to use Internet-Drafts as reference
  27.    material or to cite them other than as ``work in progress.''
  28.  
  29.    To learn the current status of any Internet-Draft, please check the
  30.    ``1id-abstracts.txt'' listing contained in the Internet-Drafts Shadow
  31.    Directories on ftp.is.co.za (Africa), ftp.nordu.net (Europe),
  32.    munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
  33.    ftp.isi.edu (US West Coast).
  34.  
  35.    The protocol discussed in this document is experimental and subject
  36.    to change.  Persons planning on either implementing or using this
  37.    protocol are STRONGLY URGED to get in touch with the author before
  38.    embarking on such a project.
  39.  
  40. Abstract
  41.  
  42.      This document describes a mail filtering language for filtering
  43.      messages at time of final delivery.  It is designed to be
  44.      independent of protocol, and implementable on either a mail client
  45.      or mail server which uses multiple folders.  It is meant to be
  46.      extensible, simple, and independent of access protocol, mail
  47.      architecture, and operating systems used to implement it.  It is
  48.      not tied to any particular system or mail architecture.  It is
  49.      suitable for running on a mail server where users may not be
  50.      allowed to execute arbitrary programs, such as on black box IMAP
  51.      servers, and has no variables, loops, or ability to shell out to
  52.      external programs.
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Showalter                                                       [Page i]
  59.  
  60. Internet Draft                   Sieve                          May 1997
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                            Table of Contents
  67.  
  68.  
  69.  
  70. Status of this memo
  71. Abstract
  72. 0. Meta-information on this draft
  73. 0.1. Discussion
  74. 0.2. Known Problems
  75. 0.2.1. Probable Extensions
  76. 0.2.2. Known Bugs
  77. 0.3. Open Issues
  78. 1. Introduction
  79. 1.1. Conventions used in this document
  80. 1.2. Example mail messages
  81. 2. Design
  82. 2.1. Form of the language
  83. 2.2. Whitespace
  84. 2.3. Comments
  85. 2.4. Numbers
  86. 2.5. Strings
  87. 2.5.2. String lists
  88. 2.5.3. Headers
  89. 2.5.4. Addresses
  90. 2.6. String Comparison
  91. 2.6.1. Match Keyword
  92. 2.6.2. Comparators
  93. 2.7. Evaluation
  94. 3. Conditionals and Control Structures
  95. 3.1. If
  96. 3.2. Require
  97. 4. Actions
  98. 4.1. Action bounce
  99. 4.2. Action fileinto
  100. 4.3. Action forward
  101. 4.4. Action keep
  102. 4.5. Action reply
  103. 4.6. Action stop
  104. 4.7. Action toss
  105. 5. Tests
  106. 5.1. all-of
  107. 5.2. any-of
  108. 5.3. exists
  109. 5.4. false
  110. 5.5. header
  111.  
  112.  
  113.  
  114. Showalter                                                      [Page ii]
  115.  
  116. Internet Draft                   Sieve                          May 1997
  117.  
  118.  
  119. 5.6. not
  120. 5.7. size
  121. 5.8. support
  122. 5.9. true
  123. 6. Errors in Processing a Script
  124. 7. Extensibility
  125. 7.1. Capability String
  126. 7.2. Registry
  127. 7.3. Capability Transport
  128. 8. Transmission
  129. 9. Acknowledgments
  130. 10.  Formal Grammar
  131. 11.  Security Considerations
  132. 12.  Author's Address
  133. Appendices
  134. Appendix A.   References
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Showalter                                                     [Page iii]
  171.  
  172. 0. Meta-information on this draft
  173.  
  174.      This information is intended to facilitate discussion.  It will be
  175.      removed when this document leaves the Internet-Draft stage.
  176.  
  177. 0.1. Discussion
  178.  
  179.      This draft is being discussed on the MTA Filters mailing list at
  180.      <ietf-mta-filters@imc.org>.  Subscription requests can be sent to
  181.      <ietf-mta-filters-request@imc.org> (send an email message with the
  182.      word "subscribe" in the body).  More information on the mailing
  183.      list along with a WWW archive of back messages is available at
  184.      <http://www.imc.org/ietf-mta-filters>.
  185.  
  186. 0.2. Known Problems
  187.  
  188. 0.2.1. Probable Extensions
  189.  
  190.      The following suggestions have been made, and will probably be
  191.      addressed by extensions.
  192.  
  193.      An extension for regular expressions will be written.  While
  194.      regular expressions are of questionable utility for most users, the
  195.      programmers writing implementations desperately want regular
  196.      expressions.
  197.  
  198.      Envelope-matching commands are not readily supported by all mail
  199.      systems, and putting them in the draft will result in a system that
  200.      cannot be implemented by a mail architecture that does not
  201.      adequately store envelopes.
  202.  
  203.      "Detailed" addressing or "sub-addressing" (i.e., the "fmh" in an
  204.      address "tjs+fmh@andrew.cmu.edu") is not handled, and will be moved
  205.      to an extension for those systems that offer it.
  206.  
  207.      A previous version included a "valid" test.  I have tentatively
  208.      removed it because Randy had noted it was too fuzzy to implement,
  209.      and that's probably true.
  210.  
  211.      A vacation command has been requested for an extension.  It isn't
  212.      in the draft because having vacation assumes you can store the
  213.      addresses of people who have already received vacation
  214.      notifications, which isn't always the case.
  215.  
  216.      A suggestion was made to set IMAP flags on delivery (e.g.,
  217.      \Flagged, \Deleted, \Answered, \Seen).
  218.  
  219.  
  220.  
  221.  
  222.  
  223. Showalter                                                       [Page 1]
  224.  
  225. Internet Draft                   Sieve                          May 1997
  226.  
  227.  
  228.      An "include" command is not included, but has been suggested for an
  229.      extension.
  230.  
  231. 0.2.2. Known Bugs
  232.  
  233.      The formal grammar should be okay, but probably isn't.
  234.  
  235.      The bounce command needs to be rechecked against the DSN
  236.      specification.
  237.  
  238.      The error-handling clauses of this specification may not be
  239.      completely sensible, and may conflict.
  240.  
  241.      My knowledge of email is not comprehensive, and as a result, there
  242.      might be a better way to express some of the concepts in here.
  243.      Please let me know if there is a good way to clean up the wording.
  244.  
  245. 0.3. Open Issues
  246.  
  247.      The support and require tests cause some serious problems with
  248.      control structures.  To some extent, this is solved by separating
  249.      the block construct out from the conditionals themselves.  This has
  250.      been done in this draft (flames welcome, but it seems to be cleaner
  251.      to me).
  252.  
  253.      Comma is mandatory in any-of/all-of but forbidden in a list of
  254.      strings it should be required in both.  This needs to be fixed.
  255.      I'm clinging to the status quo trying to fix the rest of the
  256.      problems at the moment.
  257.  
  258.      Should there be a way to specify headers transmitted by reply?
  259.      Perhaps a separate command, since there are probably sites that are
  260.      going to be really paranoid about what headers get sent.
  261.  
  262.      In the event that there is an error while processing a script, what
  263.      happens?  The draft implies you file into INBOX, but what if you've
  264.      already taken actions before you do this?  (The parts of the draft
  265.      that require syntax checking stuff are all SHOULDs.)
  266.  
  267.      I tried to fill in some of the blanks in previous versions; among
  268.      them, the description of what a bounced input message looks like,
  269.      but it's still nearly incomplete.
  270.  
  271.      What happens when someone supplies an invalid escape sequence (like
  272.      "\a") in a string or a match key?
  273.  
  274.      I moved the substring matching stuff out of the header command and
  275.      into a section of its own as it is reusable by extensions.
  276.  
  277.  
  278.  
  279. Showalter                                                       [Page 2]
  280.  
  281. Internet Draft                   Sieve                          May 1997
  282.  
  283.  
  284.      Suggestions on this section would be appreciated.
  285.  
  286.      I tried to fill in the blanks in the section on  extensibility  and
  287.      borrowed   some   stuff  from  the  ACAP  spec  (specifically,  the
  288.      comparator registry),  but  it's  probably  not  complete  or  good
  289.      enough.
  290.  
  291.      Finally, I suspect that there are a lot of problems relating to
  292.      what filtering for the masses will do to mailing lists, especially
  293.      what will happen the first time someone rolls their own vacation
  294.      program consisting of a reply command.  Should it be an error to
  295.      reply to a message that is not addressed to you (specifically)?
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335. Showalter                                                       [Page 3]
  336.  
  337. 1. Introduction
  338.  
  339.      This draft is offered to provide a standard language that can be
  340.      used to create filters for electronic mail.  It is not tied to any
  341.      particular operating system or mail architecture.  It requires the
  342.      use of [IMAIL]-compliant messages and support of multiple folders,
  343.      but should work with a wide variety of systems that support these
  344.      criteria.
  345.  
  346.      The language is powerful enough to be useful, but limited in power
  347.      in order to allow for a safe server-side filtering system.  The
  348.      intention is to make it impossible for users to do anything more
  349.      complex (and dangerous) than write simple mail filters, along with
  350.      facilitating GUI-based editors. The language is not Turing-
  351.      complete, and provides no way to write a loop or a function.
  352.      Variables are not provided.
  353.  
  354.      Implementations of the language are expected to take place at time
  355.      of final delivery, when the message is finally moved to the user-
  356.      accessible mailbox.  In systems where the MTA does final delivery,
  357.      such as and traditional UNIX mail, is reasonable to sort when the
  358.      MTA deposits mail into the user's mailbox.  If the MTA does not do
  359.      final delivery, or lacks the power to sort into separate mailboxes,
  360.      as is the case under POP3, the MUA must do filtering into local-
  361.      disk folders.
  362.  
  363.      There are a number of reasons to use a filtering system.  Mail
  364.      traffic for most users has been increasing due both to increased
  365.      usage of e-mail, the emergence of unsolicited email as a form of
  366.      advertising, and increased usage of mailing lists.
  367.  
  368.      Experience at Carnegie Mellon has shown that if a filtering system
  369.      is made available to users, many will make use of it in order to
  370.      file messages from specific users or mailing lists.  However, many
  371.      others did not make use of the Andrew system's FLAMES filtering
  372.      language due to difficulty in setting it up.
  373.  
  374.      Because of the expectation that users will make use of filtering if
  375.      it is offered and easy to use, this language has been made simple
  376.      enough to allow many users to make use of it, but rich enough that
  377.      it can be used productively.  However, it is expected that GUI-
  378.      based editors will be the preferred way of editing filters for a
  379.      large number of users.
  380.  
  381. 1.1. Conventions used in this document
  382.  
  383.      In examples, line breaks have been inserted for readability.
  384.  
  385.  
  386.  
  387.  
  388. Showalter                                                       [Page 1]
  389.  
  390. Internet Draft                   Sieve                          May 1997
  391.  
  392.  
  393.      In the sections of this document that discuss the requirements of
  394.      various keywords and operators, the following conventions have been
  395.      adopted.
  396.  
  397.      The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", "CAN",
  398.      and "MAY" in this document are to be interpreted as defined in
  399.      [KEYWORDS].
  400.  
  401.      Each section on a test, action, or control structure has a line
  402.      labeled "Syntax:".  This line describes the syntax of the command,
  403.      including its name and its arguments.  Required arguments are
  404.      listed inside angle brackets ("<" and ">").  Optional arguments are
  405.      listed inside square brackets ("[" and "]").  However, the formal
  406.      grammar for these commands in section 10 and is the authoritative
  407.      reference on how to construct these commands.
  408.  
  409. 1.2. Example mail messages
  410.  
  411.      The following mail messages will be used throughout  this  document
  412.      in examples.
  413.  
  414.      Message A
  415.      -----------------------------------------------------------
  416.      Date: Tue, 1 Apr 1997 09:06:31 -0800 (PST)
  417.      From: coyote@anvil.org
  418.      To: roadrunner@birdseed.org
  419.      Subject: I have a present for you
  420.  
  421.      Look, I'm sorry about the whole anvil thing, and I really
  422.      didn't mean to try and drop it on you from the top of the
  423.      cliff.  I want to try to make it up to you.  I've got some
  424.      great birdseed over here at my place -- top of the line
  425.      stuff -- and if you come by, I'll have it all wrapped up
  426.      for you.  I'm really sorry for all the problems I've caused
  427.      for you over the years, but I know we can work this out.
  428.      --
  429.      Wile E. Coyote       "Super Genius"       coyote@anvil.org
  430.      -----------------------------------------------------------
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444. Showalter                                                       [Page 2]
  445.  
  446. Internet Draft                   Sieve                          May 1997
  447.  
  448.  
  449.      Message B
  450.      -----------------------------------------------------------
  451.      From: youcouldberich!@reply-by-postal-mail
  452.      Sender: b1ff@de.res.frobnitzm.edu
  453.      To: rube@landru.melon.net
  454.      Date:  Mon, 31 Mar 1997 18:26:10 -0800 (PST)
  455.      Subject: $$$ YOU, TOO, CAN BE A MILLIONAIRE! $$$
  456.  
  457.      YOU MAY HAVE ALREADY WON TEN MILLION DOLLARS, BUT I DOUBT
  458.      IT!  SO JUST POST THIS TO SIX HUNDRED NEWSGROUPS!  IT WILL
  459.      GUARANTEE THAT YOU GET AT LEAST FIVE RESPONSES WITH MONEY!
  460.      MONEY! MONEY! COLD HARD CASH!  YOU WILL RECEIVE OVER
  461.      $20,000 IN LESS THAN TWO MONTHS!  AND IT'S LEGAL!!!!!!!!!
  462.      !!!!!!!!!!!!!!!!!!111111111!!!!!!!11111111111!!1  JUST
  463.      SEND $5 IN SMALL, UNMARKED BILLS TO THE ADDRESSES BELOW!
  464.      -----------------------------------------------------------
  465.  
  466. 2. Design
  467.  
  468. 2.1. Form of the language
  469.  
  470.      This language is made up as a set of commands.  Each command is
  471.      either an action or a conditional.  Each conditional contains a
  472.      test; depending on the results of the test, one set of commands in
  473.      a control structure is taken.
  474.  
  475. 2.2. Whitespace
  476.  
  477.      Whitespace is used to separate commands.  Whitespace is made up of
  478.      tabs, newlines (CRLF, never just CR or LF), and the space
  479.      character.  The amount of whitespace used is not significant.
  480.  
  481. 2.3. Comments
  482.  
  483.      Comments begin with a "#" character that is not contained within a
  484.      string and continue until the next CRLF.
  485.  
  486.      Example:    if size over 100K { # this is a comment
  487.                       toss;
  488.                  }
  489.  
  490.  
  491. 2.4. Numbers
  492.  
  493.      Numbers are given as ordinary decimal numbers.  However, those
  494.      numbers that have a tendency to be fairly large, such as message
  495.      sizes, may have a "K", "M", or "G" appended to indicate a multiple
  496.      of a base-two number.  To be comparable with the power-of-two-based
  497.  
  498.  
  499.  
  500. Showalter                                                       [Page 3]
  501.  
  502. Internet Draft                   Sieve                          May 1997
  503.  
  504.  
  505.      versions of SI units that computers frequently use, K specifies
  506.      kilo, or 1,024 (2^10) times the value of the number; M specifies
  507.      mega, or 1,048,576 (2^20) times the value of the number; and G
  508.      specifies giga, or 1,073,741,824 (2^30) times the value of the
  509.      number.
  510.  
  511.      Implementations MUST provide 31 bits of magnitude in  numbers,  but
  512.      may provide more.
  513.  
  514.      Negative, fractional, and decimal numbers are not permitted by this
  515.      draft.
  516.  
  517. 2.5. Strings
  518.  
  519.      Scripts involve large numbers of strings, as they're used for
  520.      pattern matching, addresses, and textual bodies, among other
  521.      things..  Typically, short quoted strings suffice for most uses,
  522.      but a more convenient form is provided for longer strings such as
  523.      bodies of messages.
  524.  
  525.      A quoted string starts and ends with a single double quote (the <">
  526.      character).  A backslash ("\") inside of a quoted string is
  527.      followed by either another backslash or a double quote.  This two-
  528.      character sequence represents a single backslash or double-quote
  529.      within the string, respectively.
  530.  
  531.      For entering larger amounts of text, such as an email message, a
  532.      multi-line form is allowed.  It starts with the keyword "text:",
  533.      followed by a CRLF, and ends with the sequence of a CRLF, a single
  534.      period, and another CRLF.  In order to allow the message to begin
  535.      lines with a single-dot, lines are dot-stuffed.  That is, when
  536.      composing a message body, an extra `.' is added before each line
  537.      which begins with a `.'.  When the server interprets the script,
  538.      these extra dots are removed.
  539.  
  540.      Note that a comment may occur in between the "text:" and the CRLF,
  541.      but not within the string itself.
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556. Showalter                                                       [Page 4]
  557.  
  558. Internet Draft                   Sieve                          May 1997
  559.  
  560.  
  561.  
  562.      Example:    if any-of (header ("from") contains
  563.                            ("bart" "homer" "smithers" "burns" "lisa"),
  564.                       header ("subject") contains ("URGENT")) {
  565.                       keep;
  566.                  } else {
  567.                       reply text: # multi-line message here:
  568.                  You are not one of the people I regularly correspond with.
  569.                  I have deleted your message due to the large volume of
  570.                  email I regularly receive.  If you feel that you need to
  571.                  speak with me directly, and cannot find your answer in my
  572.                  web pages, please send mail with the word "URGENT" in the
  573.                  subject line.  Thank you for your time.
  574.                  .
  575.                  ;
  576.                  }
  577.  
  578. 2.5.2. String lists
  579.  
  580.      When matching patterns, strings frequently come in groups.  For
  581.      this reason, a list of strings is allowed in many tests, implying
  582.      that if the test is true using any one of the strings, then the
  583.      test is true.  Implementations are encouraged to use short-circuit
  584.      evaluation in these cases.
  585.  
  586.      For instance, the test `header ("To" "Cc") contains
  587.      ("me@frobnitzm.edu" "me00@landru.melon.edu")' is true if either the
  588.      To header or Cc header of the input message contains either of the
  589.      e-mail addresses "me@frobnitzm.edu" or "me00@landru.melon.edu".
  590.  
  591.      Conversely, in any case where a list of strings would be
  592.      appropriate, a single string is allowed without being a member of a
  593.      list; it is equivalent to a list with a single member.  So the test
  594.      `exists "To"' is equivalent to the test `exists ("To")'.
  595.  
  596. 2.5.3. Headers
  597.  
  598.      Headers are a subset of strings.  In the Internet Message
  599.      Specification [IMAIL], each header line is allowed to have
  600.      whitespace nearly anywhere in the line, including after the field
  601.      name and before the subsequent colon.  Extra spaces between the
  602.      header name and the ":" in a header field are ignored by the
  603.      interpreter.
  604.  
  605.      A header name never contains a colon.  The "From" header refers to
  606.      a line beginning "From:" (or "From   :", etc.).  No header will
  607.      match the string "From:" due to the trailing colon.
  608.  
  609.  
  610.  
  611.  
  612. Showalter                                                       [Page 5]
  613.  
  614. Internet Draft                   Sieve                          May 1997
  615.  
  616.  
  617. 2.5.4. Addresses
  618.  
  619.      A number of commands call for email addresses, which are also a
  620.      subset of strings.  These addresses must be compliant with [IMAIL].
  621.      Implementations MUST insure the addresses are syntactically valid,
  622.      and need not insure that they are actually deliverable.
  623.  
  624. 2.6. String Comparison
  625.  
  626.      When matching one string against another, there are a number of
  627.      ways of performing the match.  These are accomplished with three
  628.      matches -- an exact match, a substring match, and a wildcard glob-
  629.      style match.  In order to provide for matches between character
  630.      sets and case insensitivity, Sieve borrows ACAP's comparator
  631.      registry.
  632.  
  633. 2.6.1. Match Keyword
  634.  
  635.      There are three allowed match keywords describing the allowed match
  636.      in this draft; they are "is", "contains", and "matches".
  637.  
  638.      The "contains" version describes a substring match.  If the value
  639.      argument contains the key argument as a substring, the match is
  640.      true.  For instance, the string "frobnitzm" contains "frob" and
  641.      "nit", but not "fbm".  The null key ("") is contained in all
  642.      values.
  643.  
  644.      The "is" version describes an absolute match; if the contents of
  645.      the first string are absolutely the same as the contents of the
  646.      second string, they match.  Only the string "frobnitzm" is the
  647.      string "frobnitzm".  The null key only "is" the null value.
  648.  
  649.      The "matches" is a UNIX-style "glob" match; it specifies that the
  650.      key is not substring, but contains certain special characters that
  651.      match characters that are not themselves.  These characters are
  652.  
  653.              *     Match zero or more characters
  654.              ?     Match any single character
  655.              \     Escape next character
  656.  
  657.      Escaped special characters do not take on the meanings listed
  658.      above.  The only valid escape sequences are "\*", "\?" and "\\".
  659.  
  660.      The value "frobnitzm" matches the keys "*nit*", "f*b*m", and
  661.      "fr?b*", but not "nit" and "frob".  The null key matches only the
  662.      null value.
  663.  
  664.      The "contains" and "matches" versions necessitate that one string
  665.  
  666.  
  667.  
  668. Showalter                                                       [Page 6]
  669.  
  670. Internet Draft                   Sieve                          May 1997
  671.  
  672.  
  673.      supplied as an argument is a key, and the other is a value.
  674.      Commands that utilize these comparisons, generally of the form
  675.      "<value> <match-keyword> <key>", must be sure to differentiate
  676.      which is which.
  677.  
  678. 2.6.2. Comparators
  679.  
  680.      In order to allow for character set-independent matches, the match
  681.      keyword may be coupled with a comparator name.  Comparators are
  682.      described for [ACAP]; a registry is defined for ACAP, and this
  683.      draft borrows that registry.
  684.  
  685.      All implementations MUST support the octet comparator, which simply
  686.      compares one octet with the next.  If left unspecified, the
  687.      comparator is octet.
  688.  
  689.      If an implementation supports a comparator "elbonia", it MUST
  690.      provide the capability "comparator-elbonia" for support and require
  691.      commands.
  692.  
  693.      Some comparators may not be usable with substring matches; that is,
  694.      they may only work with "is".  [OPEN: Not sure what to do about
  695.      this.]  It is an error to try and use a comparator with "matches"
  696.      or "contains" that is not compatible with it.
  697.  
  698.      [OPEN: Are there any other comparators that SHOULD or MUST be
  699.      supported?]
  700.  
  701. 2.7. Evaluation
  702.  
  703.      If evaluation of the script fails to file the message into any
  704.      mailbox, as in the following script, the message is filed into
  705.      INBOX.  With any of the short messages offered above, the following
  706.      script produces no actions.
  707.  
  708. Example:        if size over 500K toss;
  709.  
  710.      In cases like this, the "keep" action is taken.  The "keep" action
  711. is defined to be the action that is taken in a situation where the user
  712. does no filtering.  For instance, under an IMAP-based system, this
  713. implies filing into INBOX.
  714.  
  715. Implementations define the specific meanings of actions.
  716. Implementations MAY impose restrictions on the actions taken, such as
  717. only honoring one "reply", "bounce", or "forward" per message.
  718.  
  719. OPEN:   In this case, which is honored?  I'm tempted to say random, but
  720.         restrict it to those commands that send mail back out (fileinto
  721.  
  722.  
  723.  
  724. Showalter                                                       [Page 7]
  725.  
  726. Internet Draft                   Sieve                          May 1997
  727.  
  728.  
  729.         as many mailboxes as you want).
  730.  
  731.      Precedence is not important in any of the commands in this base
  732. specification.  However, as an extension might make order of operation
  733. important, all arguments to rules MUST be evaluated in left-to-right
  734. order.  Those operations that can implement short-circuit evaluation
  735. (such as "all-of" and "any-of") MUST do so.
  736.  
  737. 3. Conditionals and Control Structures
  738.  
  739.      In order for a script to do more than one set of actions, control
  740.      structures are needed.
  741.  
  742. 3.1. If
  743.  
  744.  
  745.      Syntax:     if <test> <command> [else <command>]
  746.  
  747.           The "if" control structure is borrowed from any number of
  748.      programming languages.  It is evaluated in the usual way, as
  749.      follows: if the test is true, the first command supplied is
  750.      evaluated.  If the test is false and an else keyword follows the if
  751.      block, the second command is evaluated.  The commands may be
  752.      command blocks.  [OPEN: This allows C-style dangling statements; I
  753.      construe this as a feature.]
  754.  
  755.      In the following example, both Message A and B are dropped.
  756.  
  757.      Example:    if header "from" contains "coyote" {
  758.                       toss;
  759.                  } else if  header ("subject") contains ("$$$") {
  760.                       toss;
  761.                  } else fileinto "INBOX";
  762.  
  763.  
  764.           Only one command or block of commands in an if ... else if ...
  765.      else chain is executed.
  766.  
  767.      In the script below, when run over message A, forwards the message
  768.      to acm@frobnitzm.edu; message B, to postmaster@frobnitzm.edu; any
  769.      other message is forwarded to field@frobnitzm.edu.
  770.  
  771.      Example:    if header ("From") contains ("coyote") {
  772.                       forward "acm@frobnitzm.edu";
  773.                  } else if header "Subject" contains "$$$" {
  774.                       forward "postmaster@frobnitzm.edu";
  775.                  } else
  776.                       forward "field@frobnitzm.edu";
  777.  
  778.  
  779.  
  780. Showalter                                                       [Page 8]
  781.  
  782. Internet Draft                   Sieve                          May 1997
  783.  
  784.  
  785. 3.2. Require
  786.  
  787.  
  788. Syntax:     require <extension-name>
  789.  
  790.      Require SHOULD be declared in a user script before an extension is
  791. used.  It instructs the evaluator that the extension named extension-
  792. name, supplied as a string, MUST be present in order to allow further
  793. processing.  If the string specifies an extension that the evaluating
  794. mechanism supports, then processing continues.  Otherwise, an error has
  795. been encountered, and the script should not be evaluated.
  796.  
  797. Require is intended to indicate that a script needs an extension not
  798. described in this document, or a feature that is not mandatory.
  799.  
  800. The following example will fail on any server that  does  not  implement
  801. the extension known as DWIM.
  802.  
  803.  
  804. Example:    require "dwim";
  805.             if header ("subject") contains-nocase ("the secret message")
  806.             {
  807.                  dwim blurdybloop body;
  808.             } stop
  809.  
  810.  
  811. OPEN:   I have serious concerns with require; it makes it impossible to
  812.         separate parsing from evaluation, and introduces some awkward
  813.         cases.  For instance, a script "if size under 1 { require "foo";
  814.         do_foo; } else {... }" Even if the test will never happen, this
  815.         require will prevent the script from working.  Just support
  816.         seems to make more sense.
  817.  
  818. 4. Actions
  819.  
  820.      This document supplies six actions that may be taken on a message:
  821.      keep, fileinto, forward, bounce, toss, and stop.
  822.  
  823. 4.1. Action bounce
  824.  
  825.  
  826. Syntax:     bounce <reason-string>
  827.  
  828.      The "bounce" action resends the message to the sender, wrapping it
  829. in a "bounce" form, noting that it was rejected by the recipient.  In
  830. the following script, message A is bounced to the sender.
  831.  
  832. Example:    if header "from" contains "coyote@anvil.org" {
  833.  
  834.  
  835.  
  836. Showalter                                                       [Page 9]
  837.  
  838. Internet Draft                   Sieve                          May 1997
  839.  
  840.  
  841.                  bounce "I am not taking mail from you, and I don't want
  842.                  your birdseed, either!";
  843.             }
  844.  
  845. A bounce message SHOULD takes the form of a failed DSN as  specified  by
  846. [DSN].   The  human-readable portion of the message, the first component
  847. of the DSN, contains the human readable message  describing  the  error,
  848. although  it SHOULD contain additional text alerting the original sender
  849. that mail was refused by a filter.  This part of the DSN might appear as
  850. follows:
  851.  
  852. ------------------------------------------------------------
  853. Message was refused by recipient's mail filtering program.
  854. Reason given was as follows:
  855.  
  856. I am not taking mail from you, and I don't want your
  857. birdseed, either!
  858. ------------------------------------------------------------
  859.  
  860.      The action-value field SHOULD be "failed".
  861.  
  862. [OPEN: This section is probably incomplete.  I am not sure that the
  863. right answer is to make it easy to refuse messages, but secretly keep a
  864. copy.  Should bounce prevent all other actions from taking affect?]
  865.  
  866. 4.2. Action fileinto
  867.  
  868.  
  869.      Syntax:     fileinto <folder>
  870.  
  871.           The "fileinto" action drops the message into a named folder.
  872.      Implementations SHOULD support fileinto, but may not be able to in
  873.      cases where the filtering agent is not able to write to the users'
  874.      folders (such as a [POP3] implementation running inside the mail
  875.      server where the folders are stored on the users' local disks).
  876.  
  877.      As such, a server supporting fileinto MUST provide the "fileinto"
  878.      capability for the support and require tests.
  879.  
  880.      In the following script, message A is filed into folder
  881.      "INBOX.harassment".
  882.  
  883.      Example:    if header ("to") contains "coyote" {
  884.                       fileinto "INBOX.harassment";
  885.                  }
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892. Showalter                                                      [Page 10]
  893.  
  894. Internet Draft                   Sieve                          May 1997
  895.  
  896.  
  897. 4.3. Action forward
  898.  
  899.  
  900.      Syntax:     forward <address>
  901.  
  902.           The "forward" action is used to forward the message to another
  903.      user at the supplied address, as a mail forwarding feature does.
  904.      The "forward" action makes no changes to the message body or
  905.      headers, and only modifies the envelope recipient.
  906.  
  907.      A simple script can be used for forwarding:
  908.  
  909.      Example:    forward "bart@frobnitzm.edu";
  910.  
  911.      The forward command performs an MTA-style forward -- that is,  what
  912.      you  get  from  a  .forward  file  using  sendmail under UNIX.  The
  913.      address on the SMTP envelope is simply replaced with the one on the
  914.      forward  command and the message is sent back out.  (This is not an
  915.      MUA-style forward, which creates a new  message  with  a  different
  916.      sender and message ID, wrapping the old message in a new one.)
  917.  
  918. 4.4. Action keep
  919.  
  920.  
  921.      Syntax:     keep
  922.  
  923.           The "keep" action is whatever action is taken in lieu of all
  924.      other actions, if no filtering happens at all; generally, this
  925.      simply means to file the message into the user's main mailbox.
  926.      This command provides a way to execute this action without needing
  927.      to know the name of the user's main mailbox, providing a way to
  928.      call it without needing to understand the user's setup, or the
  929.      underlying mail system.
  930.  
  931.      Example:    if size under 1M keep; else toss;
  932.  
  933.  
  934. 4.5. Action reply
  935.  
  936.  
  937.      Syntax:     reply <message>
  938.  
  939.           The "reply" action is used to generate a form letter reply to
  940.      the original sender.  Message is a string to be sent as a reply
  941.      message.  In the following example, any message larger than 500K
  942.      (524288 octets) would be replied to with a message explaining that
  943.      it was rejected; otherwise, the message would be filed into INBOX
  944.      (by default).
  945.  
  946.  
  947.  
  948. Showalter                                                      [Page 11]
  949.  
  950. Internet Draft                   Sieve                          May 1997
  951.  
  952.  
  953.      Example:    if size over 500K {
  954.                       reply text:
  955.                       Your message was unnecessarily large.  I reject
  956.                       all large messages; if you need to send me a large
  957.                       message, please contact me first and arrange outer
  958.                       means.
  959.                       .
  960.                       ; toss;
  961.                  }
  962.  
  963.  
  964. 4.6. Action stop
  965.  
  966.  
  967.      Syntax:     stop
  968.  
  969.           The "stop" action ends all processing.  If no actions have
  970.      been executed, then the keep action is taken.
  971.  
  972.      In the following script, if the mail is from the address
  973.      "boss@frobnitzm.edu" it is forwarded to "pleeb@frobnitzm.edu";
  974.      otherwise the mail receives a reply, and is thrown out.
  975.  
  976.      Example:    if header ("from") matches ("boss@frobnitzm.edu") {
  977.                       forward "pleeb@xanadu.wv.us";
  978.                       stop;
  979.                  } reply text:
  980.                  I'm on vacation and not taking any messages; try after
  981.                  Sunday.  I have thrown your message out.  Please resend
  982.                  it later.
  983.                  .
  984.                  ; toss;
  985.  
  986. 4.7. Action toss
  987.  
  988.  
  989.      Syntax:     toss
  990.  
  991.           Toss drops the message.  In the following script, any mail
  992.      from "idiot@frobnitzm.edu" is thrown out.
  993.  
  994.      Example:    if header ("from") contains ("idiot@frobnitzm.edu")
  995.                  toss;
  996.  
  997.           While an important part of this language, "toss" has the
  998.      potential to create serious problems for users.  For instance, a
  999.      student leaving themselves logged in to a machine in a computer lab
  1000.      may find their script changed to just "toss".  In order to protect
  1001.  
  1002.  
  1003.  
  1004. Showalter                                                      [Page 12]
  1005.  
  1006. Internet Draft                   Sieve                          May 1997
  1007.  
  1008.  
  1009.      users in this situation (along with similar situations),
  1010.      implementations MAY keep messages destroyed by a script for an
  1011.      indefinite period, and MAY disallow scripts that throw out all
  1012.      mail.
  1013.  
  1014. 5. Tests
  1015.  
  1016.      Tests are used in conditionals to decide which part(s) of the
  1017.      conditional to execute.
  1018.  
  1019. 5.1. all-of
  1020.  
  1021.  
  1022.      Syntax:     all-of ( <test> , <test> , ... <test> )
  1023.  
  1024.           The all-of test preforms a logical AND on the  tests  supplied
  1025.      to it.
  1026.  
  1027.      Example:    all-of (false, false)  =>   false
  1028.                  all-of (false, true)   =>   false
  1029.                  all-of (true, true)    =>   true
  1030.  
  1031. 5.2. any-of
  1032.  
  1033.  
  1034.      Syntax:     any-of ( <test> , <test> , ... <test> )
  1035.  
  1036.           The any-of test preforms a logical OR on the tests supplied to
  1037.      it.
  1038.  
  1039.      Example:    any-of (false, false)  =>   false
  1040.                  any-of (false, true)   =>   true
  1041.                  any-of (true, true)    =>   true
  1042.  
  1043. 5.3. exists
  1044.  
  1045.  
  1046.      Syntax:     exists <header-name-list>
  1047.  
  1048.           The "exists" test is true if the headers listed in the
  1049.      <header-name-list> argument exist within the message.  All of the
  1050.      headers must exist or the test is false.  The test
  1051.              exists ("From" "To" "Cc")
  1052.      is equivalent to
  1053.              header ("From" "To" "Cc") contains ""
  1054.  
  1055.      The following example throws out mail that doesn't have a From
  1056.      header and a Date header.
  1057.  
  1058.  
  1059.  
  1060. Showalter                                                      [Page 13]
  1061.  
  1062. Internet Draft                   Sieve                          May 1997
  1063.  
  1064.  
  1065.      Example:    if not exists ("From" "Date") {
  1066.                       toss;
  1067.                  }
  1068.  
  1069. 5.4. false
  1070.  
  1071.  
  1072.      Syntax:     false
  1073.  
  1074.           The "false" test always evaluates to false.
  1075.  
  1076. 5.5. header
  1077.  
  1078.  
  1079.      Syntax:     header <header-name-list> <match-keyword> <key-list>
  1080.  
  1081.           The "header" test evaluates to true if the any header name
  1082.      matches any key.  How the match is done is described by the second
  1083.      argument, which is one of the string comparison arguments discussed
  1084.      in section 2.6.  The first argument to header, the header-name-
  1085.      list, is a list of headers to get values from to be searched.  The
  1086.      key-list is a list of keys.
  1087.  
  1088.      If a header listed in  the  header-name-list  argument  exists,  it
  1089.      contains  the  null  key ("").  However, if the named header is not
  1090.      present, it does  not  contain  the  null  key.  So  if  a  message
  1091.      contained the header
  1092.  
  1093.              X-Caffeine: C8H10N4O2
  1094.  
  1095.      these tests on that header evaluate as follows:
  1096.  
  1097.              header ("X-Caffeine") is ("")         => false
  1098.              header ("X-Caffeine") matches ("")    => false
  1099.              header ("X-Caffeine") contains ("")   => true
  1100.  
  1101. 5.6. not
  1102.  
  1103.  
  1104.      Syntax:     not <test>
  1105.  
  1106.           The "not" test takes some other test as an argument, and
  1107.      yields the opposite result.
  1108.  
  1109. 5.7. size
  1110.  
  1111.  
  1112.      Syntax:     size <"over" / "under"> <limit [quantifier]>
  1113.  
  1114.  
  1115.  
  1116. Showalter                                                      [Page 14]
  1117.  
  1118. Internet Draft                   Sieve                          May 1997
  1119.  
  1120.  
  1121.           The "size" test deals with the size of a message.  The test is
  1122.      true only if the first argument is "over" and the size of the
  1123.      message is strictly greater than the number of octets specified as
  1124.      limit.  If the first argument is "under", then the test is true
  1125.      only if the message size is strictly less than the number of octets
  1126.      specified as limit.  In either case, if the message size is exactly
  1127.      the limit, the test is false.
  1128.  
  1129.      The size of a message is defined to be the number of octets from
  1130.      the initial header until the last character in the message body.
  1131.  
  1132. 5.8. support
  1133.  
  1134.  
  1135.      Syntax:     support <extension-name>
  1136.  
  1137.           The "support" test evaluates to true if the extension named by
  1138.      <extension-name> is supported.  In the following script, all mail
  1139.      is filed into INBOX unless the "black-magic" extension is
  1140.      supported.  Otherwise, behavior is defined by the black-magic
  1141.      extension.
  1142.  
  1143.  
  1144.      Example:    if support "black-magic" {
  1145.                       black-magic ("zork@frobnitzm.edu");
  1146.                  }
  1147.  
  1148. 5.9. true
  1149.  
  1150.  
  1151.      Syntax:     true
  1152.  
  1153.           The "true" test is always true.
  1154.  
  1155. 6. Errors in Processing a Script
  1156.  
  1157.      In any programming language, errors are inevitable.  Users are
  1158.      expected to make errors, and changes in the environment, such as a
  1159.      change in a user's rights on a mailbox, can cause a script to fail.
  1160.      It is imperative that mail be allowed to get through.
  1161.  
  1162.      Implementations SHOULD check a script before it is run in order to
  1163.      insure that it is valid.  Implementations SHOULD NOT try and
  1164.      recover from a script with errors, and should file mail into the
  1165.      user's primary mailbox.
  1166.  
  1167.      Users MUST be notified of errors in processing a script.  The
  1168.      method by which users are notified is implementation defined, but a
  1169.  
  1170.  
  1171.  
  1172. Showalter                                                      [Page 15]
  1173.  
  1174. Internet Draft                   Sieve                          May 1997
  1175.  
  1176.  
  1177.      mail message clearly describing the error is suggested if a
  1178.      preferable alternative cannot be found.
  1179.  
  1180.      In an implementation that allows for a script to be checked when it
  1181.      is turned over to the server, the script can be checked for errors
  1182.      before it is submitted.  Implementations SHOULD notify the user of
  1183.      the error and refuse to accept a syntactically invalid script or
  1184.      one that makes use of extensions that the server does not report.
  1185.  
  1186.      Implementations MUST allow mail to be filed without filtering in
  1187.      case of a syntax error in the script.  Implementations MUST avoid
  1188.      sending multiple messages describing the same error.
  1189.  
  1190.      Implementations are REQUIRED to notify users of errors in filtering
  1191.      scripts.  If there are errors in the script being used, mail SHOULD
  1192.      be filed into the user's main mailbox.  Implementations MUST NOT
  1193.      discard mail unless a command explicitly demands it.
  1194.  
  1195. 7. Extensibility
  1196.  
  1197.      New control structures, actions, and tests can be added to the
  1198.      language.  Sites must make these features known to their users;
  1199.      this document does not define a way to discover the list of
  1200.      extensions supported by the server.
  1201.  
  1202.      Any extensions to this language MUST define a string that uniquely
  1203.      identifies that extension.  If a new version of an extension
  1204.      changes the functionality of a previously defined extension, it
  1205.      MUST use a different name.  The purpose of such a string is for the
  1206.      "require" and "support" conditionals, which mandates that script
  1207.      requires the use of that extension.
  1208.  
  1209.      Additionally, in a situation where there is a submission protocol
  1210.      and an extension advertisement mechanism aware of the details of
  1211.      this language, scripts submitted can be checked against the mail
  1212.      server to prevent use of an extension that that the server does not
  1213.      support.
  1214.  
  1215. 7.1. Capability String
  1216.  
  1217.  
  1218.      Capability strings are typically short strings describing what
  1219.      capabilities are supported by the server.  The following capability
  1220.      strings are defined by this document:
  1221.  
  1222.  
  1223.      fileinto    The string "fileinto" indicates the implementation
  1224.                  supports filing into mailboxes.
  1225.  
  1226.  
  1227.  
  1228. Showalter                                                      [Page 16]
  1229.  
  1230. Internet Draft                   Sieve                          May 1997
  1231.  
  1232.  
  1233. 7.2. Registry
  1234.  
  1235.      In order to provide a standard set of extensions, a registry is
  1236.      provided by IANA.  Capability names may be registered on a first-
  1237.      come, first-served basis.  Extensions designed for interoperable
  1238.      use should be defined as standards track or IESG approved
  1239.      experimental RFCs.
  1240.  
  1241.      To: XXX@XXX.XXX Subject: Registration of new Sieve extension
  1242.  
  1243.      Capability name:
  1244.  
  1245.      Capability keyword:
  1246.  
  1247.      Capability arguments:
  1248.  
  1249.      Standards Track/IESG-approved experimental RFC number:
  1250.  
  1251.      Person and email address to contact for further information:
  1252.  
  1253. 7.3. Capability Transport
  1254.  
  1255.      As the range of mail systems that this draft is intended to apply
  1256.      to is quite large, a method of advertising which capabilities an
  1257.      implementation supports is difficult due to the wide range of
  1258.      possible implementations.  Such a mechanism, however, should have
  1259.      the following properties.
  1260.  
  1261.  
  1262.      (1)  The implementation can advertise the complete set of
  1263.           extensions that it supports.
  1264.  
  1265.           [OPEN] There needs to be a more complete description here.
  1266.  
  1267. 8. Transmission
  1268.  
  1269.      The MIME type for a SIEVE script is "application/sieve".  Scripts
  1270.      are encoded in UTF-8 during transmission.
  1271.  
  1272. 9. Acknowledgments
  1273.  
  1274.  
  1275. 10.  Formal Grammar
  1276.  
  1277.      The grammar used in this section is the same as the ABNF described
  1278.      in [ABNF].
  1279.  
  1280.      In the case of alternative or optional rules in which a later rule
  1281.  
  1282.  
  1283.  
  1284. Showalter                                                      [Page 17]
  1285.  
  1286. Internet Draft                   Sieve                          May 1997
  1287.  
  1288.  
  1289.      overlaps an earlier rule, the rule which is listed earlier MUST
  1290.      take priority.  [If you see any of these, please let me know]
  1291.  
  1292.      action = toss / fileinto / forward / bounce / reply / stop
  1293.  
  1294.      address = string
  1295.              ;; any legal [IMAIL] address
  1296.  
  1297.      any-of = "any-of" test-list
  1298.  
  1299.      all-of = "all-of" test-list
  1300.  
  1301.      block = "{" [WSP] commands [WSP] "}"
  1302.              ;; C-style block
  1303.  
  1304.      bounce = bounce WSP string
  1305.              ;; string is the reason contained in the bounce message.
  1306.  
  1307.      control-structure = if
  1308.  
  1309.      command = ( action ";" ) / block / control-structure
  1310.  
  1311.      commands = *([WSP] command [WSP])
  1312.  
  1313.      comment = "#" *CHAR CRLF
  1314.  
  1315.      comparator = octet
  1316.  
  1317.      fileinto = "fileinto" WSP string
  1318.              ;; string is a mailbox; semantics are defined by the
  1319.              ;; underlying mail system
  1320.  
  1321.      forward = "forward" WSP address
  1322.  
  1323.      if = "if" WSP test WSP command [ else command ]
  1324.              ;; Commands are typically blocks.
  1325.  
  1326.      header = "header" WSP string-list WSP match-keyword WSP string-list
  1327.  
  1328.      match-keyword = ("contains" / "matches" / "is") ["-" comparator]
  1329.  
  1330.      multi-line = "text:" [WSP] CRLF "." CRLF
  1331.              ;; Note when used,
  1332.              ;; a leading ".." on a line is mapped to ".".
  1333.  
  1334.      number = 1*DIGIT [QUANTIFIER]
  1335.              ;; quantifier is a multiplier (or bit shift)
  1336.  
  1337.  
  1338.  
  1339.  
  1340. Showalter                                                      [Page 18]
  1341.  
  1342. Internet Draft                   Sieve                          May 1997
  1343.  
  1344.  
  1345.      QUANTIFIER = "K" / "M" / "G"
  1346.              ;; K == 2^10; M == 2^20; G = 2^30
  1347.  
  1348.      quoted-string = <"> *CHAR <">
  1349.              ;; \" inside a string maps to "
  1350.              ;; \\ inside a string maps to \
  1351.              ;; All other escape sequences must be preserved.
  1352.              ;; Note that newlines and other weird characters
  1353.              ;; are all allowed strings.
  1354.  
  1355.      size = "size" WSP ( "over" / "under" ) WSP number
  1356.  
  1357.      stop = "stop"
  1358.  
  1359.      string = quoted-string / multi-line
  1360.  
  1361.      string-list = "(" [WSP] *(string WSP) string [WSP] ")" / string
  1362.              ;; if there is only a single string, the parens are optional
  1363.  
  1364.      test = [WSP] (any-of / all-of / exists / false / header /
  1365.          not / size) [WSP]
  1366.  
  1367.      test-list = [WSP] "(" [WSP] *(condition [WSP] "," [WSP])
  1368.          condition [WSP] ")" [WSP]
  1369.  
  1370.      WSP = 1*(SPACE / CRLF / tab) / comment
  1371.              ;; just whitespace.  anyplace this is allowed, a comment is
  1372.              ;; as well
  1373.  
  1374.  
  1375. 11.  Security Considerations
  1376.  
  1377.  
  1378.      Users must get their mail.  It is imperative that whatever method
  1379.      implementations use to store the user-defined filtering scripts be
  1380.      reasonably secure.
  1381.  
  1382.      It is equally important that implementations sanity-check the
  1383.      user's scripts, and not allow users to create on-demand mailbombs.
  1384.      For instance, an implementation that allows a user to bounce,
  1385.      forward, or reply multiple times to a single message might also
  1386.      allow a user to create a mailbomb triggered by mail from a specific
  1387.      user.
  1388.  
  1389.      Therefore, an implementation SHOULD only allow one "bounce" per
  1390.      message processed, and MAY limit the number of forward and reply
  1391.      actions taken.  An implementation MUST refuse to forward a message
  1392.      to itself.  [OPEN: What do you do when a site limit prevents you
  1393.  
  1394.  
  1395.  
  1396. Showalter                                                      [Page 19]
  1397.  
  1398. Internet Draft                   Sieve                          May 1997
  1399.  
  1400.  
  1401.      from this?  Say I do three replies; which ones take effect when the
  1402.      limit is 1? 2? 0?]
  1403.  
  1404.      Several commands, such as "toss", "forward", and "fileinto" allow
  1405.      for actions to be taken that are potentially very dangerous.
  1406.  
  1407. 12.  Author's Address
  1408.  
  1409.      Tim Showalter
  1410.      Carnegie Mellon University
  1411.      5000 Forbes Avenue
  1412.      Pittsburgh, PA 15213
  1413.  
  1414.      E-Mail: tjs@andrew.cmu.edu
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452. Showalter                                                      [Page 20]
  1453.  
  1454. Internet Draft                   Sieve                          May 1997
  1455.  
  1456.  
  1457. Appendices
  1458.  
  1459. Appendix A.   References
  1460.  
  1461.  
  1462.      [ABNF] Crocker, D.,  "Augmented BNF for Syntax Specifications:
  1463.      ABNF", Internet Mail Consortium, Work in Progress.
  1464.  
  1465.      [DSN] Moore, K., and G. Vaudreuil, "An Extensible Message Format
  1466.      for Delivery Status Notifications", RFC 1894, January, 1996.
  1467.  
  1468.      [KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
  1469.      Requirement Levels", RFC 2119, Harvard University, March 1997.
  1470.  
  1471.      [IMAP] Crispin, M., "Internet Mail Access Protocol - version
  1472.      4rev1", RFC 2060, University of Washington, December 1996.
  1473.  
  1474.      [IMAIL] Crocker, D., "Standard for the Format of ARPA Internet Text
  1475.      Messages", STD 11, RFC 822, University of Delaware, August 1982.
  1476.  
  1477.      [MIME] Freed, N., and N. Borenstein, "Multipurpose Internet Mail
  1478.      Extensions (MIME) Part One: Format of Internet Message Bodies", RFC
  1479.      2045, Innosoft and First Virtual, November 1996.
  1480.  
  1481.      [SMTP] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC
  1482.      821, USC/Information Sciences Institute, August 1982.
  1483.  
  1484.      [UTF-8] Yergeau, F. "UTF-8, a transformation format of Unicode and
  1485.      ISO 10646", RFC 2044, Alis Technologies, October 1996.
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508. Showalter                                                      [Page 21]
  1509.  
  1510.