Re: [exim] how exim parses multiple headers into variables

Top Page
Delete this message
Reply to this message
Author: Heiko Schlichting
Date:  
To: exim-users
Subject: Re: [exim] how exim parses multiple headers into variables
Marc Haber wrote:

> I have an interesting behavior of exim on Debian regarding multiply
> existing headers - but it also may be something really stupid.
>
> [...]
> |X-Spam-Score: -4.2
> |X-Spam-Score: -4.4
> [...]
> |headers add "${if !eq {$h_x-malware-found:}{}\
> |              {X-torres-Malware-Found: $h_x-malware-found:\n}{}}\
> |             ${if !eq {$h_x-spam-score:}{}\
> |              {X-torres-Spam-Score: $h_x-spam-score:\n}{}}\
> [...]
> Please notice that the contents of the two X-Spam-Score headers get
> folded into a single one, with an empty line between the two
> instances, and the second content without a leading space.


This is not a bug. $h_x-spam-score: has a value of "-4.2\n-4.4" within your
filter as documented:

| If there is more than one header with the same name, they are all
| concatenated to form the substitution string, up to a maximum length of
| 64K. Unless rheader is being used, leading and trailing white space is
| removed from each header before concatenation, and a completely empty
| header is ignored. A newline character is then inserted between non-empty
| headers, but there is no newline at the very end.


For insertion with correct folding you can try experimenting with $rh_...

Heiko

Heiko Schlichting                Freie Universität Berlin
heiko.schlichting@???   Zentraleinrichtung für Datenverarbeitung
Telefon +49 30 838-54327         Fabeckstraße 32
Telefax +49 30 838454327         14195 Berlin