RFC 5293

Sieve Email Filtering: Editheader Extension

πŸ“… published August 2008, from ietf

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

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