Sieve editheader should support adding Received and Auto-Submitted headers

Lee Maguire lee at hexkey.co.uk
Wed Mar 4 23:05:43 UTC 2015


In order to simplify auto-response suppression and other filtering, I want to synthesise an Auto-Submitted header on notification mails that should have them but do not.

In a sieve file I add the following: 

  if anyof ( header :contains ["From","Sender"] “info at example.com" ) {
    if header :contains "Subject" [" just joined "," just left "] {
     if not exists "Auto-Submitted" {
        addheader "Auto-Submitted" "auto-generated (via sieve)";
     }
  }

However this doesn’t work and results in the following error

> main script: line 205: warning: addheader action: specified header field `Auto-Submitted' is protected; modification denied.

(Workaround for this specific issue would probably be to use a List-* header instead.)

Looking at 
http://hg.rename-it.nl/dovecot-2.2-pigeonhole/file/c8edece267cd/src/lib-sieve/plugins/editheader/ext-editheader-common.c
I can see that "Auto-Submitted” and “Received” are hardcoded to be blocked without reference to whether they are to be added or removed.

However, the hard restriction in RFC 5293 on Auto-Submitted and Received only applies to the use of deleteheader and not addheader. 

https://tools.ietf.org/html/rfc5293#section-6

>    As a matter of local policy, implementations MAY limit which header
>    fields may be deleted and which header fields may be added.  However,
>    implementations MUST NOT permit attempts to delete "Received" and
>    "Auto-Submitted" header fields and MUST permit both addition and
>    deletion of the "Subject" header field.

Using Dovecot version 2.1.7 but I assume it’s not version specific issue.



More information about the dovecot mailing list