[Dovecot] How to rewrite header from X-Original-To to Delivered-To

Stephan Bosch stephan at rename-it.nl
Fri May 24 11:57:10 EEST 2013


Op 5/24/2013 10:39 AM, Kiran Reddy schreef:
> HiAll,
>
> How to rewrite mail headers from X-Original-To to Delivered-To using 
> sieve script.
>
> I am using Dovecot-2.2 and Pigeonhole 0.4.
>

Ehmmm.. why do you need to do that? :)

Anyway, something like this:

require "editheader";
require "variables";

# Take value from first header occurrence
if header :matches "X-Original-To" "*" {
     # delete existing headers to  prevent creating duplicate (optional)
     deleteheader "Delivered-To";

     # add the new header
     addheader "Delivered-To" "${1}";

     # delete old header (optional)
     deleteheader "X-Original-To";
}

Regards,

Stephan.



More information about the dovecot mailing list