Re: [exim-dev] headers, whitespace, and documentation

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: John Jetmore
CC: exim-dev
Subject: Re: [exim-dev] 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