RFC 8580

Sieve Extension: File Carbon Copy (FCC)

๐Ÿ“… published May 2019, from ietf

RFC 8580: Sieve Extension: File Carbon Copy (FCC) ๐Ÿ’Œ

okay bestie, the title block first ๐ŸŽ€

  • RFC number: 8580
  • Authors: K. Murchison and B. Gondwana, both at FastMail
  • Category: Standards Track
  • Date: May 2019
  • ISSN: 2070-1721
  • Updates: RFCs 5230 and 5435
  • Stream: Internet Engineering Task Force (IETF)

Abstract โœจ

okay so the Sieve email filtering language has a bunch of action commands, and some of them can make brand new messages on the user's behalf ๐Ÿ“จ this doc adds an extension to those commands so a copy of any message they generate can get filed into a target mailbox. it's giving archive energy ๐Ÿ—‚๏ธ

this doc also updates RFCs 5230 and 5435, because it adds a new tagged argument to the Vacation and Notify actions, respectively ๐Ÿฆ‹


Status of This Memo ๐ŸŒธ

this is an Internet Standards Track document ๐Ÿ’…

it's a product of the Internet Engineering Task Force (IETF), so it represents the consensus of the IETF community. it went through public review and got approved for publication by the Internet Engineering Steering Group (IESG). if you want more on Internet Standards, check out Section 2 of RFC 7841 ๐Ÿ“š

for the current status of this document, any errata, and how to give feedback, go to https://www.rfc-editor.org/info/rfc8580.


Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. ๐Ÿ’œ

this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stand on the date of publication. please read these carefully, because they spell out your rights and restrictions for this document. Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as described in the Simplified BSD License ๐Ÿงพ


Table of Contents ๐Ÿ—บ๏ธ

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
2.  Conventions Used in This Document . . . . . . . . . . . . . .   3
3.  Tagged Argument ":fcc"  . . . . . . . . . . . . . . . . . . .   3
  3.1.  Interaction with Extensions to the Fileinto Action  . . .   3
    3.1.1.  Imap4flags Extension  . . . . . . . . . . . . . . . .   4
    3.1.2.  Mailbox Extension . . . . . . . . . . . . . . . . . .   4
    3.1.3.  Special-Use Extension . . . . . . . . . . . . . . . .   4
  3.2.  Collected Grammar . . . . . . . . . . . . . . . . . . . .   5
4.  Format of FCC Messages  . . . . . . . . . . . . . . . . . . .   5
5.  Interaction with the Vacation Action  . . . . . . . . . . . .   6
6.  Interaction with the Notify Action  . . . . . . . . . . . . .   7
  6.1.  Notification-Capability "fcc" . . . . . . . . . . . . . .   7
7.  Compatibility with the Reject and Extended Reject
    Actions . . . . . . . . . . . . . . . . . . . . . . . . . . .   8
8.  Compatibility with Other Actions  . . . . . . . . . . . . . .   8
9.  Security Considerations . . . . . . . . . . . . . . . . . . .   9
10. Privacy Considerations  . . . . . . . . . . . . . . . . . . .   9
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .   9
  11.1.  Registration of New Sieve Extension  . . . . . . . . . .   9
  11.2.  Registration of New Notification-Capability
         Parameter  . . . . . . . . . . . . . . . . . . . . . . .  10
12. References  . . . . . . . . . . . . . . . . . . . . . . . . .  10
  12.1.  Normative References . . . . . . . . . . . . . . . . . .  10
  12.2.  Informative References . . . . . . . . . . . . . . . . .  12
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  12
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  12

1. Introduction โœจ

okay so the Sieve email filtering language [RFC5228] has a bunch of action commands, and some of them can generate extra messages on behalf of the user ๐Ÿ’Œ sometimes a Sieve user actually wants to keep an archive of the messages those commands make, and that's the whole reason this exists ๐Ÿ—‚๏ธ

this extension defines :fcc, a brand new optional tagged argument for action commands that generate additional messages ๐ŸŽ€ the argument lets a copy of the generated message get filed into a target mailbox. slay ๐Ÿ’…

the capability string for this extension is "fcc" ๐Ÿงš

every new action that makes additional messages will need to say how it plays with the FCC extension ๐Ÿ‘‘ this document covers that for the Vacation [RFC5230] and Notify [RFC5435] actions ๐Ÿฆ‹


2. Conventions Used in This Document ๐Ÿ“–

the notation conventions are the ones in Section 1.1 of [RFC5228], including the "Usage:" label for defining an action and the syntax of tagged arguments ๐Ÿ“

the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here ๐Ÿ”ฅ so only the all-caps versions are the official BCP 14 ones, bestie. lowercase is just regular English ๐Ÿ™ˆ


3. Tagged Argument ":fcc" ๐Ÿ’œ

this section specifies :fcc, a new optional tagged argument that changes how action commands behave when they generate additional messages on behalf of the user ๐ŸŽ€

Usage: :fcc <mailbox: string>

so :fcc tells the Sieve interpreter to file a copy of the generated message into whichever mailbox is in the argument right after it ๐Ÿ“ฌ the semantics and treatment of that mailbox argument are meant to match the mailbox argument of the fileinto action from Section 4.1 of [RFC5228] ๐ŸŒˆ specifically, using an invalid mailbox name MAY be treated as an error, or it MAY result in delivery to an implementation-defined mailbox. and if the mailbox doesn't exist, the implementation MAY treat that as an error, create the mailbox, or file the message into an implementation-defined mailbox. it's giving choose-your-own-adventure ๐Ÿงš


3.1. Interaction with Extensions to the Fileinto Action ๐Ÿฆ‹

some tagged arguments defined in extensions to the fileinto action can be used together with :fcc, and the sections below spell out how ๐ŸŒธ tagged arguments in future fileinto extensions need to describe their interaction with the FCC extension, if they have one ๐Ÿ’…

when any fileinto extension arguments get used with the FCC extension, the matching extension MUST be enabled. those arguments have the same syntax, semantics, and treatment that they have with the fileinto action ๐Ÿ”’


3.1.1. Imap4flags Extension ๐Ÿณ๏ธ

this document extends the definition of the :flags tagged argument (see Section 5 of [RFC5232]) so it can optionally be used with :fcc โœจ

Usage: :fcc <mailbox: string> [:flags <list-of-flags: string-list>]

if the optional :flags tagged argument is specified together with :fcc, the Sieve interpreter sets the IMAP4 flags provided in the next argument when the generated message gets filed into the target mailbox ๐Ÿšฉ


3.1.2. Mailbox Extension ๐Ÿ“ฎ

this document extends the definition of the :create tagged argument (see Section 3.2 of [RFC5490]) so it can optionally be used with :fcc ๐Ÿ› ๏ธ

Usage: :fcc <mailbox: string> [:create]

if the optional :create tagged argument is specified with :fcc, the Sieve interpreter creates the target mailbox, if it's needed, before it tries to file the generated message there ๐Ÿ—๏ธ


3.1.3. Special-Use Extension ๐ŸŒŸ

this document extends the definition of the :specialuse tagged argument (see Section 4 of [RFC8579]) so it can optionally be used with :fcc ๐ŸŽ€

Usage: :fcc <mailbox: string> [:specialuse <special-use-flag: string>]

if the optional :specialuse tagged argument is specified with :fcc, the Sieve interpreter checks whether a mailbox exists with that special-use flag assigned to it. if one does, the generated message gets filed into that special-use mailbox ๐ŸŽฏ otherwise, it gets filed into the target mailbox instead ๐Ÿ“ฅ

if the optional :specialuse and :create tagged arguments are both specified with :fcc, the Sieve interpreter is told to create the target mailbox, if it's needed, per Section 4.1 of [RFC8579] ๐Ÿ’–


3.2. Collected Grammar ๐Ÿงฉ

for convenience, the "FCC" syntax element is defined here using ABNF [RFC5234] so that other extensions can augment it ๐Ÿซถ

heads up: the grammar below is what "FCC" looks like after it's been lexically interpreted, so there's no whitespace or comments in it ๐Ÿ™ˆ

FCC         = ":fcc" string *FCC-OPTS
                ; per Section 2.6.2 of RFC 5228,
                ; the tagged arguments in FCC may appear in any order

FCC-OPTS    = CREATE / IMAP-FLAGS / SPECIAL-USE
                ; each option MUST NOT appear more than once

CREATE      = ":create"
IMAP-FLAGS  = ":flags" string-list
SPECIAL-USE = ":specialuse" string

4. Format of FCC Messages ๐Ÿ“ง

copies of messages filed into a mailbox through this extension are REQUIRED to be in the Internet Message Format [RFC5322] ๐Ÿ’Œ some messages that Sieve actions generate might already be in this format, and those MAY be filed without modification โœจ messages generated in any other format MUST be encapsulated using constructs from the Internet Message Format [RFC5322] and MIME ([RFC2045], [RFC2046], [RFC2047], [RFC2231]). that's the glow-up step ๐Ÿ’…

here are the general requirements for encapsulating the copies of messages that get filed:

  • Date: The Date header field is REQUIRED and SHOULD be set to the date and time when the message was generated ๐Ÿ•ฐ๏ธ
  • From: The From header field is REQUIRED and SHOULD be set to the email address of the owner of the Sieve script, unless a rule for encapsulating a particular message type explicitly overrides it ๐Ÿ‘‘
Per Erratum ID 2035 [Err2035], "Informative advice: Users often have multiple email addresses, and "the email address of the owner of the Sieve script" may offer a choice among several. If the sieve processor recognizes an address belonging to the owner of the Sieve script in the To or Cc fields of the input message, then it's better to use that address for the From field of the generated message, rather than any other addresses the script's owner may also have".

ok that erratum is lowkey important, so I kept it word for word ๐Ÿ™

  • To: The To header field is OPTIONAL and MAY be set to the email address of the recipient of the generated message, if it's available ๐Ÿ“ฌ
  • Subject: The Subject header field is OPTIONAL and MAY be generated by setting the subject to the characters "Fcc: " followed by the subject of the message being processed by the Sieve interpreter ๐Ÿท๏ธ
  • In-Reply-To: The In-Reply-To header field is OPTIONAL and MAY be set to the Message-ID of the message being processed by the Sieve interpreter ๐Ÿงต
  • Message Body: The body of the filed message is REQUIRED and is composed of one or more MIME parts containing the generated message and any related metadata ๐ŸŽ The Content-Type header field(s) MUST be set to the appropriate MIME types. If any of the MIME parts include 8-bit or binary data, the Content-Transfer-Encoding header field(s) MUST be set accordingly. so the body is the main character and it has to be formatted properly, no exceptions ๐Ÿ’€

to be continued, bestie ๐Ÿฆ‹ part 2 picks up with Section 5, the Vacation interaction, and everything after it ๐ŸŒˆโœจ

5. Interaction with the Vacation Action โœจ

okay so this doc extends the Vacation [RFC5230] action (see also "Seconds" parameter [RFC6131] to optionally store a copy of the auto-reply messages into a target mailbox. ๐Ÿ“ฌ๐Ÿ’–

Usage:   vacation [FCC]
                  [":days" number | ":seconds" number]
                  [":subject" string]
                  [":from" string]
                  [":addresses" string-list]
                  [":mime"]
                  [":handle" string]
                  <reason: string>
Example (using fileinto extensions):

require ["vacation", "fcc", "mailbox", "special-use", "imap4flags"];

vacation :days 7
         :from "hemingway@example.com" "Gone Fishin'"
         :specialuse "\\Sent" :create
         :fcc "INBOX.Sent" :flags ["\\Seen"];

bestie, the vacation auto-replies are MIME-compliant, so they can be filed into the target mailbox without any changes. no cap, that's so clean ๐Ÿงšโœจ

6. Interaction with the Notify Action

this doc also extends the Notify [RFC5435] action so it can optionally save a copy of the notification messages into a target mailbox. it's giving organized inbox ๐Ÿ—‚๏ธ๐ŸŒธ

Usage:   notify [FCC]
                [":from" string]
                [":importance" <"1" / "2" / "3">]
                [":options" string-list]
                [":message" string]
                <method: string>
Example:

require ["enotify", "fcc"];

notify :fcc "INBOX.Sent"
       :message "You got mail!"
       "mailto:ken@example.com";

notifications made with the "mailto" [RFC5436] method are MIME-compliant too, so they can be filed into the target mailbox without modification ๐ŸŽ€

okay now the spicy part ๐ŸŒถ๏ธ notifications from other methods (like "xmpp" [RFC5437]) MUST be encapsulated per Section 4 before they get filed. the body of the filed message MUST include the ":message" tagged argument and MAY include one or more of the ":from", ":importance", or ":options" tagged arguments. which MIME type(s) the body part(s) use to wrap those parameters is an implementation decision, so it's up to the implementer ๐Ÿซถ

an implementation MAY only support the FCC extension alongside a subset of the notification methods it supports. if someone uses the FCC extension with a notification method that doesn't support it, that's an error ๐Ÿ’€ notification methods that DO support the FCC extension can be discovered at runtime using the mechanism in Section 6.1.

6.1. Notification-Capability "fcc"

this doc defines "fcc", a new notification-capability value for use with the notify_method_capability test (see Section 5 of [RFC5435]. for the "fcc" notification-capability, the notify_method_capability test can match one of these key-list values:

  • yes: a copy of the notification message sent using the method identified by the notification-uri can be filed into a target mailbox โœ…
  • no: a copy of the notification message sent using the method identified by the notification-uri cannot be filed into a target mailbox โŒ

note that the "fcc" notify_method_capability test doesn't require the notification-uri argument to specify anything other than a scheme. so you can just check the scheme, babe ๐Ÿฆ‹

Example:

require ["enotify", "fcc"];

if notify_method_capability "xmpp:" "fcc" "yes" {
    notify :fcc "INBOX.Sent"
           :message "You got mail"
           "xmpp:ken@example.com?message;subject=SIEVE";
} else {
    notify :fcc "INBOX.Sent"
           :message "You got mail!"
           "mailto:ken@example.com";
}

7. Compatibility with the Reject and Extended Reject Actions

this part is SO important ๐Ÿšจ implementations MUST NOT allow the FCC extension to be used with the reject and ereject [RFC5429] actions. letting it work with these would break the SMTP [RFC5321] rule that a message is either delivered or bounced back to the sender ๐Ÿ˜ญ because the saved copy of the rejection message would contain the original message. not it ๐Ÿ™…โ€โ™€๏ธ

it's an error for a script to use the ":fcc" tagged argument with either the reject or ereject action.

8. Compatibility with Other Actions

the FCC extension isn't compatible with any Sieve action that doesn't generate an extra message on behalf of the user. if a script uses the ":fcc" tagged argument with one of those actions, that's an error ๐Ÿ™ˆ

future extensions that define actions which generate extra messages on behalf of the user need to describe how they work with the FCC extension, and how to MIME-encapsulate the message if that's required. future-you will thank present-you ๐Ÿงš

9. Security Considerations

okay listen up, this section is serious ๐Ÿ”ฅ in addition to the security considerations in [RFC5228], [RFC5230], [RFC5435], and [RFC6131], it should be noted that filing copies of generated messages may cause the Sieve script owner to exceed the allocated storage (quota) on the mail system. when that happens, future messages destined for the owner can get blocked from being delivered. that's a whole disaster arc ๐Ÿ’€

10. Privacy Considerations

also, privacy check ๐Ÿ‘€ in addition to the privacy considerations in [RFC5228], [RFC5230], [RFC5435], and [RFC6131], it should be noted that a copy of a generated message filed into a shared or public mailbox (as opposed to a private mailbox) could expose private information about the Sieve script owner to third parties. for instance, people who can access that shared or public mailbox might find out the script owner is on holiday, or even figure out their physical location. the girls in the shared folder are NOT sending me ๐Ÿ˜ญ๐ŸŒ

11. IANA Considerations

11.1. Registration of New Sieve Extension

IANA has registered the following Sieve extension in the "Sieve Extensions" registry at <https://www.iana.org/assignments/sieve-extensions>:

   Capability name: fcc

   Description: Adds the ":fcc" parameter to Sieve action commands
   that generate additional messages.

   RFC number: RFC 8580

   Contact address: The Sieve discussion list <sieve@ietf.org>

11.2. Registration of New Notification-Capability Parameter

IANA has registered the following notification-capability parameter in the "Notification-Capability Parameters" registry at <https://www.iana.org/assignments/notification-capability-parameters>:

   Capability Name: fcc

   Description: Returns whether a copy of the notification message
   sent using the method identified by the notification-uri parameter
   to the notify_method_capability test can be filed into a target
   mailbox.

   Syntax: Can contain one of two values: "yes" or "no".  Values MUST
   be in lowercase.

   Reference: RFC 8580

   Contact: The Sieve discussion list <sieve@ietf.org>

12. References

12.1. Normative References

   [RFC2045]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
              Extensions (MIME) Part One: Format of Internet Message
              Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996,
              <https://www.rfc-editor.org/info/rfc2045>.

   [RFC2046]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
              Extensions (MIME) Part Two: Media Types", RFC 2046,
              DOI 10.17487/RFC2046, November 1996,
              <https://www.rfc-editor.org/info/rfc2046>.

   [RFC2047]  Moore, K., "MIME (Multipurpose Internet Mail Extensions)
              Part Three: Message Header Extensions for Non-ASCII Text",
              RFC 2047, DOI 10.17487/RFC2047, November 1996,
              <https://www.rfc-editor.org/info/rfc2047>.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119,
              DOI 10.17487/RFC2119, March 1997,
              <https://www.rfc-editor.org/info/rfc2119>.

   [RFC2231]  Freed, N. and K. Moore, "MIME Parameter Value and Encoded
              Word Extensions: Character Sets, Languages, and
              Continuations", RFC 2231, DOI 10.17487/RFC2231, November
              1997, <https://www.rfc-editor.org/info/rfc2231>.

   [RFC5228]  Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email
              Filtering Language", RFC 5228, DOI 10.17487/RFC5228,
              January 2008, <https://www.rfc-editor.org/info/rfc5228>.

   [RFC5230]  Showalter, T. and N. Freed, Ed., "Sieve Email Filtering:
              Vacation Extension", RFC 5230, DOI 10.17487/RFC5230,
              January 2008, <https://www.rfc-editor.org/info/rfc5230>.

   [RFC5232]  Melnikov, A., "Sieve Email Filtering: Imap4flags
              Extension", RFC 5232, DOI 10.17487/RFC5232, January 2008,
              <https://www.rfc-editor.org/info/rfc5232>.

   [RFC5234]  Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
              Specifications: ABNF", STD 68, RFC 5234,
              DOI 10.17487/RFC5234, January 2008,
              <https://www.rfc-editor.org/info/rfc5234>.

   [RFC5322]  Resnick, P., Ed., "Internet Message Format", RFC 5322,
              DOI 10.17487/RFC5322, October 2008,
              <https://www.rfc-editor.org/info/rfc5322>.

   [RFC5429]  Stone, A., Ed., "Sieve Email Filtering: Reject and
              Extended Reject Extensions", RFC 5429,
              DOI 10.17487/RFC5429, March 2009,
              <https://www.rfc-editor.org/info/rfc5429>.

   [RFC5435]  Melnikov, A., Ed., Leiba, B., Ed., Segmuller, W., and T.
              Martin, "Sieve Email Filtering: Extension for
              Notifications", RFC 5435, DOI 10.17487/RFC5435, January
              2009, <https://www.rfc-editor.org/info/rfc5435>.

   [RFC5490]  Melnikov, A., "The Sieve Mail-Filtering Language --
              Extensions for Checking Mailbox Status and Accessing
              Mailbox Metadata", RFC 5490, DOI 10.17487/RFC5490, March
              2009, <https://www.rfc-editor.org/info/rfc5490>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/info/rfc8174>.

   [RFC8579]  Bosch, S., "Sieve Email Filtering: Delivering to Special-
              Use Mailboxes", RFC 8579, DOI 10.17487/RFC8579, May 2019,
              <https://www.rfc-editor.org/info/rfc8579>.

12.2. Informative References

   [Err2035]  RFC Errata, Errata ID 2035, RFC 5230,
              <https://www.rfc-editor.org/errata_search.php?eid=2035>.

   [RFC5321]  Klensin, J., "Simple Mail Transfer Protocol", RFC 5321,
              DOI 10.17487/RFC5321, October 2008,
              <https://www.rfc-editor.org/info/rfc5321>.

   [RFC5436]  Leiba, B. and M. Haardt, "Sieve Notification Mechanism:
              mailto", RFC 5436, DOI 10.17487/RFC5436, January 2009,
              <https://www.rfc-editor.org/info/rfc5436>.

   [RFC5437]  Saint-Andre, P. and A. Melnikov, "Sieve Notification
              Mechanism: Extensible Messaging and Presence Protocol
              (XMPP)", RFC 5437, DOI 10.17487/RFC5437, January 2009,
              <https://www.rfc-editor.org/info/rfc5437>.

   [RFC6131]  George, R. and B. Leiba, "Sieve Vacation Extension:
              "Seconds" Parameter", RFC 6131, DOI 10.17487/RFC6131, July
              2011, <https://www.rfc-editor.org/info/rfc6131>.

Acknowledgments ๐Ÿซถ

huge thank yous to Ned Freed, Stan Kalisch, and Alexey Melnikov for contributing their ideas and supporting this spec. the real MVPs ๐Ÿ‘‘๐Ÿ’–

Authors' Addresses ๐ŸŒˆ

   Kenneth Murchison
   FastMail US LLC
   1429 Walnut Street, Suite 1201
   Philadelphia, PA  19102
   United States of America

   Email: murch@fastmailteam.com


   Bron Gondwana
   FastMail Pty Ltd
   Level 2, 114 William Street
   Melbourne, VIC  3000
   Australia

   Email: brong@fastmailteam.com
๐Ÿ“ฆ where this page comes from