Lee Maguire
2015-Mar-04 23:05 UTC
Sieve editheader should support adding Received and Auto-Submitted headers
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.
Stephan Bosch
2015-Mar-06 19:05 UTC
Sieve editheader should support adding Received and Auto-Submitted headers
On 3/5/2015 12:05 AM, Lee Maguire wrote:> 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.Oh, looks like I missed that part. Fixed: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/c13471f102be I've split up the configuration to allow separate configuration of addheader/deleteheader. Updated documentation: http://hg.rename-it.nl/dovecot-2.2-pigeonhole/raw-file/c13471f102be/doc/extensions/editheader.txt Regards, Stephan.