Re: [exim] headers_add produces duplicate header

Top Page
Delete this message
Reply to this message
Author: Yves Goergen
Date:  
To: Jasen Betts, exim-users
Subject: Re: [exim] headers_add produces duplicate header
Thank you, this has resolved my issue.

Yves


________________________________________
Von: Jasen Betts
Gesendet: Do, 2017-06-08 21:33 +0200
On 2017-06-08, Yves Goergen <nospam.list@???> wrote:
> Oops, I forgot to mention another thing. That's already in place. Here's
> more of my config around the headers_add block:
>
>> headers_remove = X-Virus*:X-Virus-Scanned:X-Spam-DCC:X-SpamChecker-Version:\
>>     X-Spam-Status:X-Spam-RBL:X-Spam-Eval\
>>     ${if !eq {$acl_VAR_SUBJECT}{} {::Subject}{}}\
>>     ${if !eq {$acl_VAR_SPAM_SCORE}{} {::X-Spam-Score}{}}\
>>     ${if !eq {$acl_VAR_SPAM_REPORT}{} {::X-Spam-Report}{}}

>>
>> headers_add    = ${if !eq {$acl_VAR_SUBJECT}{} {Subject: $acl_VAR_SUBJECT\n}{}}\
>>     ${if !eq {$acl_VAR_SPAM_SCORE}{} {X-Spam-Score: $acl_VAR_SPAM_SCORE\n}{}}\
>>     ${if !eq {$acl_VAR_SPAM_REPORT}{} {X-Spam-Report: $acl_VAR_SPAM_REPORT\n}{}}

>
> So the Subject header should already be removed. Why is it suplicated
> anyway?



list splitting happens before variable substitution.
so headers_remove does not do what you want, and subject is not removed.

headers_remove = X-Virus*:X-Virus-Scanned:X-Spam-DCC:X-SpamChecker-Version:\
        X-Spam-Status:X-Spam-RBL:X-Spam-Eval\
        : ${if !eq {$acl_VAR_SUBJECT}{} {Subject}{}}\
        : ${if !eq {$acl_VAR_SPAM_SCORE}{} {X-Spam-Score}{}}\
        : ${if !eq {$acl_VAR_SPAM_REPORT}{} {X-Spam-Report}{}}


or this:

headers_remove = X-Virus*:X-Virus-Scanned:X-Spam-DCC:X-SpamChecker-Version:\

X-Spam-Status:X-Spam-RBL:X-Spam-Eval:Subject:X-Spam-Score:X-Spam-Report