RFC 5490

The Sieve Mail-Filtering Language -- Extensions for Checking Mailbox Status and Accessing Mailbox Metadata

๐Ÿ“… published March 2009, from ietf

RFC 5490: The Sieve Mail-Filtering Language -- Extensions for Checking Mailbox Status and Accessing Mailbox Metadata โœจ

okay bestie, this one is from March 2009 and it's Standards Track ๐ŸŽ€ It's by A. Melnikov at Isode Limited, and it's part of the Network Working Group. The header doesn't list anything it obsoletes or updates, so it's a standalone add-on ๐Ÿ’…


Status of This Memo

This document is an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements ๐Ÿซถ For the current standardization state and status, check the "Internet Official Protocol Standards" (STD 1) edition. Distribution of this memo is unlimited ๐ŸŒธ

Copyright (c) 2009 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, as they stood on the publication date. The legal provisions are at http://trustee.ietf.org/license-info. Read them carefully, because they spell out your rights and restrictions for this document ๐Ÿ’…

This document may include material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The people who control the copyright in some of that material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process ๐Ÿ™ˆ Without an adequate license from them, this document can't be modified outside the IETF Standards Process, and derivative works can't be made outside it either. The one exception is formatting it for publication as an RFC, or translating it into languages other than English ๐ŸŒˆ

Abstract

This memo is the Sieve mail filtering language extension (RFC 5228) for reading mailbox and server annotations, checking whether a mailbox exists, and controlling mailbox creation on the "fileinto" action ๐Ÿฆ‹

Table of Contents

   1. Introduction ....................................................2
   2. Conventions Used in This Document ...............................2
   3. "mailbox" and "mboxmetadata" Extensions .........................2
      3.1. Test "mailboxexists" .......................................2
      3.2. ":create" Argument to "fileinto" Command ...................3
      3.3. Test "metadata" ............................................4
      3.4. Test "metadataexists" ......................................4
   4. "servermetadata" Extension ......................................5
      4.1. Test "servermetadata" ......................................5
      4.2. Test "servermetadataexists" ................................6
   5. Security Considerations .........................................6
   6. IANA Considerations .............................................7
   7. Acknowledgements ................................................7
   8. References ......................................................8
      8.1. Normative References .......................................8
      8.2. Informative References .....................................8

1. Introduction ๐Ÿงš

okay so this memo adds an extension to the Sieve mail filtering language [SIEVE] that lets scripts read mailbox and server annotations ๐Ÿ’– That means you can customize how the Sieve engine behaves based on variables set through [METADATA]. Iconic ๐Ÿ‘‘

It also defines an extension for checking whether a mailbox exists, and for controlling mailbox creation on the "fileinto" action โœจ

2. Conventions Used in This Document ๐ŸŽ€

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 [KEYWORDS] ๐Ÿซถ

The notation conventions follow [SIEVE] Section 1.1, including the use of [ABNF] ๐Ÿ’…

This document assumes you already know the data model and the terms defined in Section 3 of [METADATA] ๐ŸŒธ

3. "mailbox" and "mboxmetadata" Extensions ๐Ÿฆ‹

3.1. Test "mailboxexists" ๐Ÿ’–

Usage is:

Usage:  mailboxexists <mailbox-names: string-list>

The "mailboxexists" test is true if every mailbox listed in the "mailbox-names" argument exists in the mailstore, and each one lets the user in whose context the Sieve script runs "deliver" messages into it โœจ When the mailstore is an IMAP server, delivery is possible if:

a. the READ-WRITE response code is present for the mailbox (see Section 7.1 of [IMAP]), if IMAP Access Control List (ACL) [IMAPACL] isn't supported by the server, or

b. the user has 'p' or 'i' rights for the mailbox (see Section 5.2 of [IMAPACL]).

Here's the lowkey important bit ๐Ÿ™ˆ A successful "mailboxexists" test doesn't necessarily mean a "fileinto" action on that mailbox will succeed. For example, the "fileinto" action might put the user over quota ๐Ÿ’€ "mailboxexists" only checks that the mailbox exists and that the user in whose context the Sieve script runs has permission to run "fileinto" on it ๐Ÿ”ฅ

The capability string for the require command is mailbox ๐ŸŒˆ

Example time! This example assumes the Sieve engine also supports "reject" [REJECT] and "fileinto" [SIEVE]. But those extensions aren't required to implement the "mailbox" extension ๐Ÿงš

require ["fileinto", "reject", "mailbox"];
if mailboxexists "Partners" {
   fileinto "Partners";
} else {
   reject "This message was not accepted by the Mailstore";
}

3.2. ":create" Argument to "fileinto" Command ๐Ÿ“

Usage is:

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

so the optional ":create" argument tells the Sieve interpreter to create the specified mailbox, if it's needed, before it tries to deliver the message there โœจ If the mailbox already exists, the argument is ignored. And if creating the mailbox fails, that's considered an error ๐Ÿ˜ญ

The capability string for the ":create" parameter is mailbox ๐Ÿ’œ

3.3. Test "metadata" ๐Ÿฆ‹

Usage is:

Usage:  metadata [MATCH-TYPE] [COMPARATOR]
        <mailbox: string>
        <annotation-name: string> <key-list: string-list>

This test grabs the value of the mailbox annotation "annotation-name" for the mailbox "mailbox" [METADATA] ๐Ÿ’… The value it gets back is compared to the "key-list", and the test returns true if the annotation exists and its value matches any of the keys โœจ

The default match type is ":is" [SIEVE], and the default comparator is "i;ascii-casemap" [SIEVE] ๐ŸŒธ

The capability string for the require command is mboxmetadata ๐ŸŽ€

Annotations MUST be accessed with the permissions of the user in whose context the Sieve script runs. Annotations starting with the "/private" prefix MUST be those of that same user. This part is non-negotiable, bestie ๐Ÿ”ฅ

Example! This one assumes the Sieve engine also supports the "vacation" [VACATION] extension. But this extension isn't required to implement the "mboxmetadata" extension ๐Ÿงš

    require ["mboxmetadata", "vacation"];

    if metadata :is "INBOX"
       "/private/vendor/vendor.isode/auto-replies" "on" {

        vacation text:
    I'm away on holidays till March 2009.
    Expect a delay.
    .
    }

3.4. Test "metadataexists" ๐ŸŒˆ

Usage is:

Usage:  metadataexists <mailbox: string> <annotation-names: string-
        list>

The "metadataexists" test is true if all of the annotations listed in the "annotation-names" argument exist (meaning they have non-NIL values) for the specified mailbox ๐Ÿ’–

The capability string for the require command is mboxmetadata ๐Ÿซถ

to be continued in part 2 โœจ next up is section 4, "servermetadata" Extension, with the rest of the security considerations and references ๐Ÿ’…

6. IANA Considerations ๐Ÿ“ฎ

IANA has added these three registrations to the list of Sieve extensions ๐Ÿ’Œ

     To: iana@iana.org
     Subject: Registration of new Sieve extension
     Capability name: mailbox
     Description: adds test for checking for mailbox existence and a new
                  optional argument to fileinto for creating a mailbox
                  before attempting mail delivery.
     RFC number: this RFC
     Contact address:
         The Sieve discussion list <ietf-mta-filters@imc.org>

     Capability name: mboxmetadata
     Description: adds tests for checking for mailbox metadata item
                  existence and for retrieving of a mailbox metadata
                  value.
     RFC number: this RFC
     Contact address:
         The Sieve discussion list <ietf-mta-filters@imc.org>

     Capability name: servermetadata
     Description: adds tests for checking for server metadata item
                  existence and for retrieving of a server metadata
                  value.
     RFC number: this RFC
     Contact address:
         The Sieve discussion list <ietf-mta-filters@imc.org>

7. Acknowledgements ๐Ÿซถ

Huge thanks to Cyrus Daboo, who is the reason this whole document exists in the first place ๐Ÿ’–

Also a big shoutout to Barry Leiba, Randall Gellens, and Aaron Stone for their super helpful comments on the draft ๐ŸŒธ

And the author wants to thank the Open Mobile Alliance's Mobile Email working group ๐Ÿ“ฑโœจ They put together a set of requirements for mobile devices, and those requirements helped guide some of the extensions in here ๐Ÿฆ‹

8. References ๐Ÿ“š

8.1. Normative References

[ABNF]: Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008. ๐Ÿงฉ

[IMAP]: Crispin, M., "Internet Message Access Protocol - Version 4rev1", RFC 3501, March 2003. ๐Ÿ“ฌ

[IMAPACL]: Melnikov, A., "IMAP4 Access Control List (ACL) Extension", RFC 4314, December 2005. ๐Ÿ”

[KEYWORDS]: Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐Ÿ”‘

[METADATA]: Daboo, C., "The IMAP METADATA Extension", RFC 5464, February 2009. ๐Ÿท๏ธ

[SIEVE]: Guenther, P. and T. Showalter, "Sieve: An Email Filtering Language", RFC 5228, January 2008. ๐ŸŒˆ

8.2. Informative References

[NOTIFY]: Melnikov, A., Leiba, B., Segmuller, W., and T. Martin, "Sieve Email Filtering: Extension for Notifications", RFC 5435, January 2009. ๐Ÿ””

[REJECT]: Stone, A., "Sieve Email Filtering: Reject and Extended Reject Extensions", RFC 5429, March 2009. ๐Ÿšซ

[VACATION]: Showalter, T. and N. Freed, "Sieve Email Filtering: Vacation Extension", RFC 5230, January 2008. ๐Ÿ–๏ธ

[VARIABLES]: Homme, K., "Sieve Email Filtering: Variables Extension", RFC 5229, January 2008. ๐Ÿงฎ

Author's Address ๐Ÿ’

   Alexey Melnikov
   Isode Limited
   5 Castle Business Village
   36 Station Road
   Hampton, Middlesex  TW12 2BX
   UK

   EMail: Alexey.Melnikov@isode.com
๐Ÿ“ฆ where this page comes from