Re: email header wrapping and truncation



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jack,

On 07/21/2017 03:18:56 PM Fri, Jack wrote:
Greetings all,

This is a problem that has bitten me in the past, but I finally tracked it down, with sufficient examples to 
demonstrate the problem.

In most cases, email headers (in the actual message) are

Header:  content

However, for some long values, it appears as

Header:
 content

If the content is long enough, you get

Header:
 first part of header, but tr
         uncated and wrapped.

It seems that in this last case, Balsa only sees the first line as the value of that header ("first part of header, but 
tr") which can cause a problem, if, for example, it is the "Reply-to:" header.  I now have two examples of this 
actually happening.  One is marketing messages I used to get from consumer cellular.  The other is from the gentoo.org mailing 
list system.  If I send a subscribe reqeust, it replies with a message I need to reply to to confirm the request.  However, it's 
Reply-to is of the third form above, and not noticing the truncation, my first reply just got me an error bounce.

Most interesting however, is that when I went to find the comsumer cellular example, I found a fourth type:

Header: Initial part o
 f header, with more here, and th
         e remainder here

In this case, Balsa gets the entire content of the header without problem.

I suppose the difference between the third and fourth types depends on one of the mail handlers between the 
sender and the one I get the message from by POP3.  However, I don't know if consumer cellular changed their 
system, or something changed someplace else in between, or perhaps some change in Balse (or a library) as all 
examples I can find of the third type are older than the fourth type.

Sorry for rambling, but hopefully this explains my issue enough for someone to either confirm it or point out 
what I'm doing wrong.

Let me know if you need any other info, such as versions of libraries my Balsa is compiled against.

Thanks for any help.

Jack

Sorry to read about the problems you're seeing!

Those continuation lines (beginning with WSP: space or tab) are all supposed to be 'unfolded' by 
concatenating them with the 'Header:' line. Balsa hands off the whole job of parsing the message to GMime, 
which then provides unfolded headers on request. The GMime code that handles unfolding has been stable for 
many years.

Perhaps the lines that don't get concatenated have some other non-printing character before the WSP. Where do 
you see the folded headers? In an mbox? Can you check for other spurious characters?

Best,

Peter
-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQS030wPRfNNA5alz3MfX9S1uSp09QUCWXJthgAKCRAfX9S1uSp0
9TSuAJ9lmvonxEkT8Nk8TXTHSPmum/HiKwCfayw9JBJHu+Ddf12P3cTGSXzotoI=
=7P7v
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]