Sieve Email Filtering: Delivery Status Notifications and Deliver-By Extensions
Extracted elements (22)
Redirect-dsn and redirect-deliverby both require setting the envelope sender to the Sieve owner's address when their respective time/notification parameters are specified, because these extensions are not useful if the destination for delivery status notifications is unknown.
The ':bytimerelative' argument on redirect does not allow negative values because there is no use case for specifying a negative delivery time limit in this context, unlike the 'bytimerelative' envelope-part which may receive negative values from the transport layer.
The Deliver-By by-time is decremented as a message passes through the transport infrastructure, so 'bytimerelative' values can be negative. Scripts must either perform additional checks or use a comparator capable of handling signed integers (i;ascii-numeric cannot handle negative values).
The ':zone' argument for bytimeabsolute uses RFC 5322 time zone offset format ((+/-)4DIGIT), not ISO 8601 format. This distinction is important for implementors converting between formats.
If the Deliver-By SMTP extension is unavailable, handling of a redirected message with redirect-deliverby arguments MUST conform to RFC 2852 Section 4.1.4 semantics for relaying to a server that does not support the Deliver-By extension.
In the 'bytimeabsolute' value, the letters 'T' and 'Z' MUST be in upper case, and a time zone offset of zero MUST be represented by 'Z' and not '+00:00', per the restricted ISO 8601 format.
It is an error to specify an ADDRESS-PART argument in conjunction with the new envelope-part strings defined by envelope-dsn (notify, orcpt, ret, envid) or envelope-deliverby, as none of these have address syntax.
It is an error to specify ':bymode' or ':bytrace' without either ':bytimeabsolute' or ':bytimerelative' in the redirect-deliverby extension.
When either ':bytimeabsolute' or ':bytimerelative' is specified in redirect-deliverby and the envelope sender address is not empty, implementations MUST set the envelope sender address to the address of the Sieve owner.
When either ':notify' or ':ret' is specified in redirect-dsn and the envelope sender address is not empty, implementations MUST set the envelope sender address to the address of the Sieve owner.
When the DSN ESMTP extension is not available, the ':notify' and ':ret' arguments to redirect MUST be ignored and MUST NOT cause an error.
The 'envelope-deliverby' extension adds four envelope-part strings: 'bytimeabsolute' (BY parameter converted to restricted ISO 8601 format), 'bytimerelative' (raw BY integer value), 'bymode' ('notify' or 'return'), and 'bytrace' ('trace' or empty string), plus an optional ':zone' argument for time zone shifting of bytimeabsolute.
The 'envelope-dsn' extension adds four new envelope-part strings to the Sieve envelope test: 'notify' (DSN NOTIFY conditions), 'orcpt' (original recipient), 'ret' (return of content), and 'envid' (envelope identifier), corresponding to SMTP DSN extension parameters from RFC 3461.
The 'notify' envelope-part matches the list of notification conditions (NEVER, SUCCESS, FAILURE, DELAY) associated with the SMTP RCPT TO NOTIFY parameter. Each condition is tested separately, and any match causes the test to succeed; 'NEVER' is never combined with other values.
The 'orcpt' envelope-part matches the original recipient value from the SMTP RCPT TO ORCPT parameter with xtext encoding removed. It always contains an address type indicator prefix (e.g., 'rfc822;') in addition to the address.
The 'redirect-deliverby' extension adds ':bytimerelative', ':bytimeabsolute', ':bymode', and ':bytrace' arguments to the redirect action, constructing the BY ESMTP MAIL FROM parameter. ':bymode' and ':bytrace' require either ':bytimeabsolute' or ':bytimerelative' to also be specified.
The 'redirect-dsn' extension adds ':notify' and ':ret' arguments to the Sieve redirect action, setting the NOTIFY ESMTP RCPT TO and RET ESMTP MAIL FROM parameters respectively when the DSN ESMTP extension is available.
The ':zone' tagged argument for the envelope test specifies a time zone offset string in the format (+/-)4DIGIT (agreeing with RFC 5322 format, not ISO 8601). It only affects the 'bytimeabsolute' envelope-part; if omitted, local time zone is used.
Four new Sieve extension capability names are registered with IANA: 'envelope-dsn', 'envelope-deliverby', 'redirect-dsn', and 'redirect-deliverby', all defined in RFC 6009.
The envelope-dsn and envelope-deliverby extensions provide access to additional message envelope information but are not believed to raise security issues beyond those for the base Sieve 'envelope' test.
The redirect-deliverby extension controls how long the transport infrastructure attempts delivery, potentially generating additional notification messages. Although Deliver-By has a minimum by-time limit, sites may wish to impose additional minimum by-time limits on redirect actions.
The redirect-dsn extension allows specification of the NOTIFY parameter, which can cause generation of notification messages (especially success notifications) that might otherwise not be generated. Sites limiting success notification requests must also restrict their use via redirect-dsn.