[Dovecot] How to rewrite header from X-Original-To to Delivered-To
Kiran Reddy
kiran at uniceltech.com
Fri May 24 15:15:38 EEST 2013
Thanks for quick reply.
a {color: #F77A1E;} On 5/24/2013 5:39 PM, Stephan Bosch wrote:
> Op 5/24/2013 1:45 PM, Kiran Reddy schreef:
>> Hi,
>>
>> If mail headers contains 2 lines Delivered-To and 1 X-Original-To. I
>> want to keep first line of Delivered-To and X-Original-To and delete
>> 2nd line of Delivered-To and rewrite X-Original-To to Delivered-To.
>>
>> Please find the mail headers as below.
>>
>> X-Original-To: 98862xxx65 at example.in ====> Rewrite this to Delivered-TO
>> Delivered-To: mobilemail at example.in ====> KEEP This Header
>> Delivered-To: example.com-mobilenumbers at example.com =======> Delete
>> This Header
>
> If you can rely on the exact order of these headers, this should work:
>
> require "editheader";
> require "variables";
>
> if header :matches "X-Original-To" "*" {
> deleteheader :index 2 "Delivered-To";
> addheader "Delivered-To" "${1}";
> deleteheader "X-Original-To";
> }
>
> Regards,
>
> Stephan.
>
More information about the dovecot
mailing list