Mailing List Archive

Re: headers, whitespace, and documentation
On Tue, 17 Oct 2006, John Jetmore wrote:

> The documentation isn't really clear on what happens with leading and
> trailing whitespace when there are multiple headers of the same name.

> I assumed that either it would remove leading and trailing WS from each
> header before the concatenation, or that leading and trailing WS would be
> removed from the single concatenation. In fact what happens is that
> leading WS is removed from each header before cat and trailing is
> removed from the end of the entire string after cat. So, if intermediate
> headers had trailing whitespace it will be preserved in the cat.

I suspect the code does what happened to fall out in the wash. In other
words, I wrote the code for one header and didn't think about the
consequences of what would happen for multiple headers.

> Consider for example an email that has these headers:
>
> Cc: a@b
> Cc: c@d
> Cc: e@f
>
> (there are four spaces after the c@d line, in case some m[tu]a munges it.)
> In that case the value of $h_cc: is:
>
> a@b,
> c@d ,
> e@f
>
> Which doesn't seem like what is desired.

I think you are right. It is untidy. I'll take a look sometime.

--
Philip Hazel University of Cambridge Computing Service
Get the Exim 4 book: http://www.uit.co.uk/exim-book

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
Re: headers, whitespace, and documentation [ In reply to ]
On Tue, 17 Oct 2006, John Jetmore wrote:

> Consider for example an email that has these headers:
>
> Cc: a@b
> Cc: c@d
> Cc: e@f
>
> (there are four spaces after the c@d line, in case some m[tu]a munges it.)
> In that case the value of $h_cc: is:
>
> a@b,
> c@d ,
> e@f
>
> Which doesn't seem like what is desired.

I have committed code that fixes this (remove trailing whitespace
*before* each line is concatenated).

Philip

--
Philip Hazel, University of Cambridge Computing Service.

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##