RFC 5230
Sieve Email Filtering: Vacation Extension
RFC 5230: Sieve Email Filtering: Vacation Extension ๐ (Part 1 of 3)
Working group: Network Working Group ๐ซถ Authors: T. Showalter, and N. Freed (Ed.), both from Sun Microsystems โจ Category: Standards Track ๐ Date: January 2008 ๐๏ธ Obsoletes / Updates: The header doesn't list anything this one obsoletes or updates ๐ง
Status of This Memo
okay so this one is an Internet standards track protocol for the Internet community, and it's literally asking everyone to chime in with discussion and suggestions ๐ฌ. If you want the current standardization state, check the "Internet Official Protocol Standards" (STD 1) doc. Distribution of this memo is unlimited ๐ธ.
Abstract
this doc adds an extension to the Sieve email filtering language ๐. It's an autoresponder that's basically a cousin of the Unix "vacation" command, so it can reply to messages for you while you're out. There are also various safety features baked in to stop things like message loops from happening ๐.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Conventions Used in This Document . . . . . . . . . . . . . . 3
3. Capability Identifier . . . . . . . . . . . . . . . . . . . . 3
4. Vacation Action . . . . . . . . . . . . . . . . . . . . . . . 3
4.1. Days Parameter . . . . . . . . . . . . . . . . . . . . . . 3
4.2. Previous Response Tracking . . . . . . . . . . . . . . . . 4
4.3. Subject and From Parameters . . . . . . . . . . . . . . . 6
4.4. MIME Parameter . . . . . . . . . . . . . . . . . . . . . . 6
4.5. Address Parameter and Limiting Replies to Personal
Messages . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.6. Restricting Replies to Automated Processes and Mailing
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.7. Interaction with Other Sieve Actions . . . . . . . . . . . 8
4.8. Examples . . . . . . . . . . . . . . . . . . . . . . . . . 9
5. Response Message Generation . . . . . . . . . . . . . . . . . 9
5.1. SMTP MAIL FROM Address . . . . . . . . . . . . . . . . . . 9
5.2. Date . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3. Subject . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.4. From . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.5. To . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5.6. Auto-Submitted . . . . . . . . . . . . . . . . . . . . . . 10
5.7. Message Body . . . . . . . . . . . . . . . . . . . . . . . 10
5.8. In-Reply-To and References . . . . . . . . . . . . . . . . 10
6. Relationship to Recommendations for Automatic Responses to
Electronic Mail . . . . . . . . . . . . . . . . . . . . . . . 11
7. Internationalization Considerations . . . . . . . . . . . . . 11
8. Security Considerations . . . . . . . . . . . . . . . . . . . 12
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 13
10.1. Normative References . . . . . . . . . . . . . . . . . . . 13
10.2. Informative References . . . . . . . . . . . . . . . . . . 13
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 15
1. Introduction โจ
bestie, this is the core vibe ๐ฆ. The doc defines an extension to the Sieve language from [RFC5228], and the whole point is letting someone say "hey, I won't be answering messages sent to me right away" ๐ธ.
2. Conventions Used in This Document
so for notations, we just follow [RFC5228] section 1.1 ๐.
The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", "REQUIRED", and "MAY" in this document are to be interpreted as defined in [RFC2119] ๐. These are the official rule words, so they're the ones to watch ๐.
3. Capability Identifier
any Sieve implementation that does vacation gets the identifier vacation for the capability mechanism ๐.
4. Vacation Action
the usage is giving full structure ๐ :
Usage: vacation [":days" number] [":subject" string]
[":from" string] [":addresses" string-list]
[":mime"] [":handle" string] <reason: string>
The vacation action is a vacation autoresponder, very much like the vacation command you'll find in lots of Unix versions ๐ง. Its whole job is to tell people that you're away for a while and that they shouldn't expect a quick reply ๐.
Vacation replies go out to a message's Return-Path address, which is the envelope from address of the message being answered ๐ฌ. So it's answering the envelope sender, not just whoever the From header says ๐.
4.1. Days Parameter
the :days argument sets how long addresses get remembered and left alone ๐
. It's always in days โณ. The usual minimum is 1 โจ. Sites MAY define a different minimum, as long as that minimum is greater than 0 ๐. Sites MAY also define a maximum days value ๐. That maximum MUST be greater than 7 and SHOULD be greater than 30 ๐.
If :days is left out, the default is either 7 or the minimum value, whichever is bigger ๐.
If the number given to :days is below the minimum, the minimum gets used instead ๐ซถ.
If :days goes over the site's maximum, the maximum gets used instead ๐
.
4.2. Previous Response Tracking
okay this section is the big one, so grab a snack ๐ฟ. vacation keeps a record of every response it's sent to each address during whatever period the :days argument sets ๐. If it hasn't already sent that response to this address within that window, it sends the "reason" text to the SMTP MAIL FROM address [RFC2821] of the message being answered ๐. (The SMTP MAIL FROM address should be available in the Return-path: header field if Sieve processing happens after final delivery ๐ญ.)
Tracking isn't only per address, though. It has to care about the vacation response itself too ๐ฏ. For example, a script writer might set things up so a general notice only goes out once every two weeks ๐๏ธ. But even if someone already got that general notice, it could still matter to send a specific one when something timely or specific shows up in a message ๐ฅ.
There are two ways to tell which vacation response is which ๐ฏ.
The first way is an explicit :handle argument, which gives the response a name ๐ท๏ธ. Every vacation statement using the same handle counts as the same response for tracking ๐.
The second way is a mix of the :subject, :from, :mime, and reason arguments ๐งฉ. Any vacation actions without an explicit handle that use the exact same combo of those arguments count as the same response for tracking ๐ฆ.
Here's a little story ๐บ. If coyote@desert.example.org emails roadrunner@acme.example.com twice, once with the subject "Cyrus bug" and once with the subject "come over for dinner", and roadrunner@acme.example.com runs this script:
require "vacation";
if header :contains "subject" "cyrus" {
vacation "I'm out -- send mail to cyrus-bugs";
} else {
vacation "I'm out -- call me at +1 304 555 0123";
}
then coyote@desert.example.org gets two responses, one for each message ๐. The second one still arrives even though coyote already got the first, because those are separate vacation responses being triggered ๐ . This behavior is REQUIRED. ๐
There's one important exception, though ๐จ. If the Sieve variables extension [RFC5229] is in use, the arguments MUST NOT have gone through variable expansion before they're used for response tracking ๐ง . That's so a script like this one only sends a single response to each incoming message with a different subject line โจ:
require ["vacation", "variables"];
if header :matches "subject" "*" {
vacation :subject "Automatic response to: ${1}"
"I'm away -- send mail to foo in my absence";
}
Now, the optional :handle parameter can tell the Sieve interpreter to treat two vacation actions with different arguments as the same command for tracking ๐. The :handle argument is a string that names the type of response being sent ๐ท๏ธ. For instance, say tweety@cage.example.org emails spike@doghouse.example.com twice, once with the subject "lunch?" and once with the subject "dinner?", and spike@doghouse.example.com runs this script:
require "vacation";
if header :contains "subject" "lunch" {
vacation :handle "ran-away" "I'm out and can't meet for lunch";
} else {
vacation :handle "ran-away" "I'm out";
}
then tweety@cage.example.org only ever gets one response ๐ฅ. Which one depends on the order the messages get processed in ๐.
NOTE: One way to build the mechanism here is to store a hash of the current handle plus the recipient address. If there's no handle, store a hash of the vacation action parameters that describe the message content, plus the recipient address ๐. If a script changes, implementations MAY reset the records of who has been responded to and when ๐งน.
IMPLEMENTATION NOTE: You have to be careful when hashing vacation action parameters ๐ง. Most of the parameters are optional, so it's important not to let the same string used as the value for different parameters end up producing the same hash value ๐. One possible approach is to hash a series of counted or null-terminated strings, one for each possible parameter, in a particular order ๐ข.
Implementations are free to limit how many remembered responses they keep ๐๏ธ. The limit MUST NOT be less than 1000 ๐ฏ. When an implementation does limit the tracked responses, it SHOULD discard the oldest ones first ๐.
4.3. Subject and From Parameters
the :subject parameter sets the subject line for any vacation response that gets generated ๐. UTF-8 characters are allowed in that string argument ๐. Implementations MUST convert the string to [RFC2047] encoded words if and only if non-ASCII characters are present ๐ค. Implementations MUST also generate an appropriate default subject line, as described below, if no :subject parameter is specified ๐ซถ.
A :from parameter can be used to name an alternate address for the From field of vacation messages ๐. The string has to be a valid [RFC2822] mailbox-list ๐ฎ. Implementations SHOULD check the syntax and produce an error when a syntactically invalid :from parameter shows up ๐ซ. Implementations MAY also put restrictions on which addresses can be specified in a :from parameter ๐ก๏ธ. It's suggested that values failing such a validity check just get ignored, rather than making the vacation action fail ๐ฆ.
4.4. MIME Parameter โจ
okay so the :mime parameter is the glow-up option ๐
If you include it, the reason string isn't just plain text anymore. It's a whole MIME entity (see [RFC2045] section 2.4), with the MIME headers and the content both living inside it.
If you don't include :mime, the reason string gets treated as a UTF-8 string. Simple, bestie ๐ซถ
Here's a full MIME example, so you can see the vibe:
require "vacation";
vacation :mime text:
Content-Type: multipart/alternative; boundary=foo
--foo
I'm at the beach relaxing. Mmmm, surf...
--foo
Content-Type: text/html; charset=us-ascii
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML><HEAD><TITLE>How to relax</TITLE>
<BASE HREF="http://home.example.com/pictures/"></HEAD>
<BODY><P>I'm at the <A HREF="beach.gif">beach</A> relaxing.
Mmmm, <A HREF="ocean.gif">surf</A>...
</BODY></HTML>
--foo--
.
4.5. Address Parameter and Limiting Replies to Personal Messages ๐
okay this one is so important, it's basically the bouncer at the club ๐ง "Vacation" MUST NOT respond to a message unless the recipient user's email address shows up in a "To", "Cc", "Bcc", "Resent-To", "Resent-Cc", or "Resent-Bcc" line of the original message.
An address counts as belonging to the recipient if it's one of these:
- an email address the implementation already knows is linked to the recipient,
- the final envelope recipient address, if the implementation can see it, or
- an address the script writer adds with the ":addresses" argument (more on that in the next paragraph).
Users can list extra mail addresses that are also theirs with the :addresses argument. It takes a string-list of additional addresses a user might have. Those addresses count as belonging to the recipient, on top of whatever the implementation already knows about ๐
4.6. Restricting Replies to Automated Processes and Mailing Lists ๐ค
Implementations MAY refuse to send a vacation response to a message that has any header or content making it look like a response wouldn't be appropriate. Totally optional, but a really good call ๐ธ
Implementations MUST have a list of addresses that "vacation" MUST NOT send mail to. The contents of that list are implementation defined. The whole point is to keep mail away from addresses run by system daemons that wouldn't care whether you're actually reading your mail ๐
Implementations are encouraged to include well-known addresses like "MAILER-DAEMON", "LISTSERV", "majordomo", and other addresses usually used only by automated systems. Addresses ending in "-request" or starting with "owner-" are also suggested, since those are reserved for mailing list software ๐ฆ
Implementors may take guidance from [RFC2142], but they should be careful. Some addresses, like "POSTMASTER", are generally run by actual people, and people do care when you're unavailable ๐
Implementations SHOULD NOT respond to any message that contains a "List-Id" [RFC2919], "List-Help", "List-Subscribe", "List-Unsubscribe", "List-Post", "List-Owner", or "List-Archive" [RFC2369] header field. Mailing list mail is not your auto-reply's stage โจ
Implementations SHOULD NOT respond to any message that has an "Auto-Submitted" header field with a value other than "no". This header field is described in [RFC3834] ๐ซถ
4.7. Interaction with Other Sieve Actions ๐
Vacation does not affect Sieve's implicit keep action. Your mail still gets kept, no drama ๐
Vacation can only be executed once per script. A script MUST fail with an appropriate error if it tries to run two or more vacation actions. One reply per script, periodt ๐
Implementations MUST NOT consider vacation used with discard, keep, fileinto, or redirect an error. The vacation action is incompatible with the Sieve reject and refuse actions [REJECT], so don't mix those up ๐ โโ๏ธ
4.8. Examples ๐
Here's a simple use of vacation, lowkey the easiest thing ever:
require "vacation";
vacation :days 23 :addresses ["tjs@example.edu",
"ts4z@landru.example.edu"]
"I'm away until October 19.
If it's an emergency, call 911, I guess." ;
Once you mix vacation with other rules, you can get way more selective ๐ง
require "vacation";
if header :contains "from" "boss@example.edu" {
redirect "pleeb@isp.example.org";
} else {
vacation "Sorry, I'm away, I'll read your
message when I get around to it.";
}
5. Response Message Generation ๐จ
This section spells out the requirements for the generated response message. Pay attention, it's the important part ๐ฅ
The input message and arguments may be in UTF-8, and implementations MUST deal with UTF-8 input. Implementations MAY transcode to other character sets as regional taste dictates ๐ When :mime is used, the reason argument also contains MIME header information. Those headers have to follow MIME conventions, so 8bit text is not allowed. Implementations SHOULD reject vacation :mime actions that contain 8bit header material.
5.1. SMTP MAIL FROM Address ๐
The SMTP MAIL FROM address of the message envelope SHOULD be set to <>. NOTIFY=NEVER SHOULD also be set in the RCPT TO line during the SMTP transaction if the NOTARY SMTP extension [RFC3461] is available.
5.2. Date ๐
The Date field SHOULD be set to the date and time when the vacation response was generated. This might not match the time the message got delivered to the user, so don't be confused if they're different โฐ
5.3. Subject ๐ท
Users can set the Subject of the reply with the :subject parameter. If :subject isn't supplied, the subject gets generated like this: the characters "Auto: " followed by the original subject. And if :subject isn't specified and the original message has no Subject field, an appropriate fixed Subject, such as "Automated reply", SHOULD be used instead ๐
5.4. From ๐ซ
Unless it's explicitly overridden with a :from parameter, the From field SHOULD be set to the address of the owner of the Sieve script.
5.5. To ๐ฆ
The To field SHOULD be set to the address of the recipient of the response.
5.6. Auto-Submitted ๐ค
An Auto-Submitted field with a value of "auto-replied" SHOULD be included in the message header of any vacation message sent. This is how the world knows it's a bot talking ๐ค
5.7. Message Body ๐
The body of the message is taken from the reason string in the vacation command. Simple and iconic.
5.8. In-Reply-To and References ๐งต
Replies MUST have the In-Reply-To field set to the Message-ID of the original message, and the References field SHOULD be updated with the Message-ID of the original message.
If the original message doesn't have a Message-ID, an In-Reply-To need not be generated, and References need not be changed.
Section 3.6.4 of [RFC2822] gives you the full rundown on how References fields should be generated, so go check it if you want the deets ๐ง
6. Relationship to Recommendations for Automatic Responses to Electronic Mail ๐
The vacation extension implements a "Personal Responder" in the terminology defined in [RFC3834]. Care has been taken in this specification to comply with the recommendations of [RFC3834] about how personal responders should behave. Respect โจ
7. Internationalization Considerations ๐
Internationalization capabilities provided by the base Sieve language are discussed in [RFC5228]. However, the vacation extension is the first Sieve extension that can create entirely new messages, so this section covers the i18n issues that come up with vacation specifically ๐
Vacation messages are normally written in the UTF-8 charset, so text can be written in most of the world's languages. The :mime parameter also lets you specify arbitrary MIME content. That makes it possible to use multipart/alternative objects to write vacation responses in several languages at the same time ๐ธ
The Sieve language itself lets a vacation response be picked based on the content of the original message. For example, the Accept-Language or Content-Language header fields [RFC3282] could be checked and used to choose the right text:
require "vacation";
if header :contains ["accept-language", "content-language"] "en"
{
vacation "I am away this week.";
} else {
vacation "Estoy ausente esta semana.";
}
Heads up though, this kind of simple test of the field values doesn't look at the structure of the fields, so some fancier field values can fool it. A more elaborate test could fix that problem ๐
Explicitly coding language selection criteria into scripts is the preferred approach, because language selection often gets mixed up with other selection issues. For example, you might want informal text in one language for replies to a fellow employee, and more formal text in a different language for a total stranger outside the company:
require "vacation";
if address :matches "from" "*@ourdivision.example.com"
{
vacation :subject "Gone fishing"
"Having lots of fun! Back in a day or two!";
} else {
vacation :subject "Je suis parti cette semaine"
"Je lirai votre message quand je retourne.";
}
IMPLEMENTATION NOTE: A graphical Sieve generation interface could, in principle, hide the complexity of specifying response selection criteria from end users. Figuring out the right set of options to show in a graphical interface is likely a nontrivial proposition ๐ง That's more because of the need to use a variety of criteria to pick different kinds of responses for different groups of people, than because of the issues involved in picking a response in an appropriate language.
8. Security Considerations ๐
It is critical that implementations correctly implement the behavior and restrictions described throughout this document. Replies MUST NOT be sent out in response to messages not sent directly to the user, and replies MUST NOT be sent out more often than the :days argument states, unless the script changes. This is serious, bestie, no cap ๐ญ
If mail is forwarded from a site that uses subaddressing, it may be impossible to list all recipient addresses with ":addresses". Rough, but true ๐
Security issues associated with mail auto-responders are fully discussed in the security considerations section of [RFC3834]. This document is believed not to introduce any additional security considerations in this general area ๐
9. IANA Considerations ๐งพ
The following template specifies the IANA registration of the vacation Sieve extension specified in this document:
To: iana@iana.org
Subject: Registration of new Sieve extension
Capability name: vacation
Description: adds an action for generating an auto-reply saying
that the original message will not be read or
answered immediately
RFC number: RFC 5230
Contact address: The Sieve discussion list <ietf-mta-filters@imc.org>
This information has been added to the list of Sieve extensions given on http://www.iana.org/assignments/sieve-extensions ๐
10. References ๐
10.1. Normative References
okay so these are the must-read docs ๐ the spec leans on hard, and you need them to actually understand what's going on ๐ค
[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message
Bodies", RFC 2045, November 1996.
[RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions)
Part Three: Message Header Extensions for Non-ASCII Text",
RFC 2047, November 1996.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2822] Resnick, P., "Internet Message Format", RFC 2822,
April 2001.
[RFC3461] Moore, K., "Simple Mail Transfer Protocol (SMTP) Service
Extension for Delivery Status Notifications (DSNs)",
RFC 3461, January 2003.
[RFC3834] Moore, K., "Recommendations for Automatic Responses to
Electronic Mail", RFC 3834, August 2004.
[RFC5228] Guenther, P., Ed. and T. Showalter, Ed., "Sieve: An Email
Filtering Language", RFC 5228, January 2008.
[RFC5229] Homme, K., "Sieve Email Filtering: Variables Extension",
RFC 5229, January 2008.
10.2. Informative References
these ones are more like bonus reading ๐ง โจ super useful for context but the spec doesn't depend on them, so no panic if you skip ๐
[REJECT] Stone, A., Elvey, M., and A. Melnikov, "Sieve Email
Filtering: Reject Extension", Work in Progress,
October 2007.
[RFC2142] Crocker, D., "MAILBOX NAMES FOR COMMON SERVICES, ROLES AND
FUNCTIONS", RFC 2142, May 1997.
[RFC2369] Neufeld, G. and J. Baer, "The Use of URLs as Meta-Syntax
for Core Mail List Commands and their Transport through
Message Header Fields", RFC 2369, July 1998.
[RFC2821] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821,
April 2001.
[RFC2919] Chandhok, R. and G. Wenger, "List-Id: A Structured Field
and Namespace for the Identification of Mailing Lists",
RFC 2919, March 2001.
[RFC3282] Alvestrand, H., "Content Language Headers", RFC 3282,
May 2002.
Appendix A. Acknowledgements ๐
this whole extension is obviously inspired by Eric Allman's vacation program under Unix ๐ด the authors really owe a lot to Carnegie Mellon University ๐, Cyrus Daboo, Lawrence Greenfield, Michael Haardt, Kjetil Torgrim Homme, Arnt Gulbrandsen, Mark Mallett, Alexey Melnikov, Jeffrey Hutzelman, and Philip Guenther ๐ซถ plus a bunch of other people whose names got lost during the inexcusably long gestation period of this document ๐ญ we love you all, even the ghosts of the drafts ๐ป
Authors' Addresses ๐
here's who to reach out to if you have questions about the spec ๐ฆ
Tim Showalter
EMail: tjs@psaux.com
Ned Freed (editor)
Sun Microsystems
3401 Centrelake Drive, Suite 410
Ontario, CA 92761-1205
USA
Phone: +1 909 457 4293
EMail: ned.freed@mrochek.com
Full Copyright Statement ๐
the legal bits ๐ I'm keeping this one word-for-word so nothing gets fuzzy, because lawyers are not the vibe we're going for, but they do matter ๐
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 ๐
ngl this part is about who owns what ๐ and it's giving very careful, very official ๐ so here it is in full:
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.
and that's the whole thing, bestie ๐โจ you made it through all three parts ๐
๐ฆ where this page comes from
- ietf: rfc5230 2008-01
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms