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

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Evgeniy Berdnikov
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] how exim parses multiple headers into variables
On Sun, May 03, 2015 at 11:19:16PM +0200, Heiko Schlittermann wrote:
> Marc Haber <mh+exim-users@???> (Sa 02 Mai 2015 21:39:30 CEST):
> > On Fri, 1 May 2015 21:38:31 +0200, Heiko Schlittermann
> > <hs@???> wrote:
> > >Seing this, there is no bug in Exim. Exim does just what you told it to
> > >do. As indicated by the filter test output.
> >
> > I see. It's still clumsy behavior that the output of $h_header_foo
> > cannot be inserted into another header without jumping through hoops.
>
> Which result whould you expect, if you "fold" multiple headers into one?
>
> > >Using 'headers add "x-torres-spam-score: $h_x-spam-score"' IS wrong.
> > yes. that violates the principle of least surprise.
>
> You try to put the values of multiple headers (of the same
> name) into one header. How should this be done with less suprise?
> (Same question as above.)


IMHO, the least surprise would be separation of header values by HTAB
character (ASCII value 9, or "\t"). HTAB is a legal white space symbol
as defined by RFC822, but is rarely used by existing software.

In order to do correct concatenation of header lines, one should trim
all consequent white space charaters (SPACE, HTAB and LF) to single space
before construction of HTAB-separated list. The result can be used later
either as a list, or as a single string, and can be safely used for $h_*
substitution.
--
Eugene Berdnikov