RFC 5490
The Sieve Mail-Filtering Language -- Extensions for Checking Mailbox Status and Accessing Mailbox Metadata
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 Notice
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
- ietf: rfc5490 2009-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms