RFC 5293
Sieve Email Filtering: Editheader Extension
RFC 5293: Sieve Email Filtering: Editheader Extension β¨
okay so bestie, this one is from the Network Working Group π«Ά It's by J. Degener and P. Guenther at Sendmail, Inc., it's on the Standards Track, and it's dated August 2008. It doesn't obsolete or update any other RFCs, so it's a standalone glow-up for the Sieve filtering language π
Status of This Memo π
this is an Internet standards track protocol for the Internet community, and the authors are literally asking for discussion and suggestions for improvements π₯Ί for the current standardization state and status, check the "Internet Official Protocol Standards" (STD 1) doc. and distribution of this memo is unlimited π
Abstract π¦
this doc adds two brand new actions to the "Sieve" email filtering language, one to add email header fields and one to delete them. it's giving customization π
1. Introduction πΈ
email header fields are such a flexible, easy-to-understand way for email processors to talk to each other β¨ this extension lets sieve scripts work with the other components that read or write header fields, by letting the script delete and add them. iconic teamwork π§
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 doc are to be read as described in [KEYWORDS]. these are the official rules-words, so they're capitalized on purpose π₯
notation conventions follow Section 1.1 of [SIEVE], including the "Usage:" label for defining actions and the tagged arguments syntax π
and "header field" means what [IMAIL] means by it: a logical line of an email message header π
3. Capability Identifier π§
the capability string for this extension is editheader π
4. Action addheader π
Usage:
"addheader" [":last"] <field-name: string> <value: string>
so the addheader action adds a header field to the existing message header β¨ if the field-name isn't a legit 7-bit US-ASCII header field name (per the [IMAIL] "field-name" nonterminal syntax element), the implementation MUST flag an error π and addheader does not affect Sieve's implicit keep. no drama there π
if the field value doesn't match the [IMAIL] "unstructured" nonterminal syntax element, or it's longer than a length limit the implementation sets, the implementation MUST either flag an error or encode the field using folding white space and the encodings described in [MIME3] or [MIMEPARAM], so it stays compliant with [IMAIL] π the vibe is always compliance, periodt π
an implementation MAY impose a length limit on the size of the encoded header field π¦ but that limit MUST NOT be less than 998 characters, not counting the terminating CRLF the implementation supplies π«Ά
by default, the new header field goes at the beginning of the existing message header. if you add the optional flag ":last", it gets appended at the end instead π
example time (this one is so cute π₯Ή):
/* Don't redirect if we already redirected */
if not header :contains "X-Sieve-Filtered"
["<kim@job.example.com>", "<kim@home.example.com>"]
{
addheader "X-Sieve-Filtered" "<kim@job.example.com>";
redirect "kim@home.example.com";
}
5. Action deleteheader π₯
Usage:
Usage: "deleteheader" [":index" <fieldno: number> [":last"]]
[COMPARATOR] [MATCH-TYPE]
<field-name: string>
[<value-patterns: string-list>]
by default, deleteheader deletes every occurrence of the named header field π it does not affect Sieve's implicit keep either π§
the field-name is mandatory, and it's always matched as a case-insensitive US-ASCII string πΈ if it isn't a valid 7-bit header field name (per the [IMAIL] "field-name" nonterminal syntax element), the implementation MUST flag an error β¨
the value-patterns, if you give them, narrow down which occurrences get deleted to the ones whose values match any of the patterns. the matching works according to the match-type and comparator, and it's done as if by the "header" test π and leading and trailing whitespace in field values gets ignored. if you don't specify any value-patterns, then the comparator and match-type options are silently ignored π
if you use :index <fieldno>, matching is limited to the <fieldno> occurrence of the named header field, counting from 1, where 1 is the first one π¦ with :last, the count goes backwards, so 1 is the last named header field, 2 is the second to last, and so on. the counting happens before any <value-patterns> matching π for example:
deleteheader :index 1 :contains "Delivered-To"
"bob@example.com";
this deletes the first "Delivered-To" header field if it contains the string "bob@example.com". it does not delete the first "Delivered-To" field that contains "bob@example.com" π big difference, bestie π
it's not an error if no header fields match the conditions in deleteheader, or if :index is bigger than the number of named header fields π«Ά
and the implementation MUST flag an error if :last is specified without also specifying :index π₯
6. Implementation Limitations on Changes π§
as a matter of local policy, implementations MAY limit which header fields may be deleted and which header fields may be added π but implementations MUST NOT permit attempts to delete "Received" and "Auto-Submitted" header fields, and they MUST permit both addition and deletion of the "Subject" header field π the "Received" and "Auto-Submitted" fields are protected, and "Subject" is always fair game β¨
if a script tries to make a change that isn't permitted, the attempt MUST be silently ignored π no error, no fuss, just quietly skipped π
10. Acknowledgments π
okay bestie, big shoutout π£ to the whole crew who gave extensive corrections and suggestions π«Ά: Eric Allman, Cyrus Daboo, Matthew Elvey, Ned Freed, Arnt Gulbrandsen, Kjetil Torgrim Homme, Simon Josefsson, Will Lee, William Leibzon, Mark E. Mallett, Chris Markle, Alexey Melnikov, Randall Schwartz, Aaron Stone, Nigel Swinson, and Rand Wacker πβ¨
11. References π
11.1. Normative References π
these are the ones you HAVE to read, no skipping π
[IMAIL] Resnick, P., Ed., "Internet Message Format", RFC 2822,
April 2001.
[KEYWORDS] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[MIME3] Moore, K., "MIME (Multipurpose Internet Mail Extensions)
Part Three: Message Header Extensions for Non-ASCII
Text", RFC 2047, November 1996.
[MIMEPARAM] Freed, N. and K. Moore, "MIME Parameter Value and
Encoded Word Extensions: Character Sets, Languages, and
Continuations", RFC 2231, November 1997.
[SIEVE] Guenther, P., Ed., and T. Showalter, Ed., "Sieve: An
Email Filtering Language", RFC 5228, January 2008.
11.2. Informative References π
these are the extra reads π¦ helpful but not required
[BODY] Degener, J. and P. Guenther, "Sieve Email Filtering:
Body Extension", RFC 5173, April 2008.
[DKIM] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton,
J., and M. Thomas, "DomainKeys Identified Mail (DKIM)
Signatures", RFC 4871, May 2007.
[DSN] Moore, K. and G. Vaudreuil, "An Extensible Message
Format for Delivery Status Notifications", RFC 3464,
January 2003.
[MDN] Hansen, T., Ed., and G. Vaudreuil, Ed., "Message
Disposition Notification", RFC 3798, May 2004.
[OPENPGP] Elkins, M., Del Torto, D., Levien, R., and T. Roessler,
"MIME Security with OpenPGP", RFC 3156, August 2001.
[SMIME] Ramsdell, B., Ed., "Secure/Multipurpose Internet Mail
Extensions (S/MIME) Version 3.1 Message Specification",
RFC 3851, July 2004.
[SMTP] Klensin, J., Ed., "Simple Mail Transfer Protocol", RFC
2821, April 2001.
[VACATION] Showalter, T. and N. Freed, Ed., "Sieve Email Filtering:
Vacation Extension", RFC 5230, January 2008.
Authors' Addresses π
Jutta Degener 5245 College Ave, Suite #127 Oakland, CA 94618
EMail: jutta@pobox.com
Philip Guenther Sendmail, Inc. 6475 Christie Ave., Ste 350 Emeryville, CA 94608
EMail: guenther@sendmail.com
Full Copyright Statement Β©οΈ
Copyright (C) The IETF Trust (2008).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Intellectual Property π
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.
Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. πΈ
π¦ where this page comes from
- ietf: rfc5293 2008-08
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms