[issue35863] email.headers wraps headers badly

2019-02-01 Thread R. David Murray
R. David Murray added the comment: Well, "display" in the context of email includes looking at the raw email serialized as a text file. This is something one can do in most mailers. I use nmh as my mailer, which only shows raw headers, so I myself would be personally affected if headers wer

[issue35863] email.headers wraps headers badly

2019-02-01 Thread Jon Ribbens
Jon Ribbens added the comment: I did read the RFCs. I suspect the [CFWS] in the msg-id is for the benefit of the references production which contains a list of msg-ids. The 78-character suggested line length limit is explicitly noted as being for display purposes, and therefore is of little

[issue35863] email.headers wraps headers badly

2019-01-31 Thread R. David Murray
R. David Murray added the comment: The rules are: lines should be less than 78 characters; and that lines may be broken only at FWS (folding whitespace), not in the middle of words. Putting these rules together, you get the result that the email library produces. "Conservative in what you

[issue35863] email.headers wraps headers badly

2019-01-31 Thread Jon Ribbens
Jon Ribbens added the comment: It is not correct folding. It might not be explicitly forbidden, but it is clearly unwise, and is breaking 'conservative in what you send'. Outlook will not be the only program that fails to parse Python's output. -- ___

[issue35863] email.headers wraps headers badly

2019-01-31 Thread R. David Murray
R. David Murray added the comment: Also note that you might want to switch to the new API, the folder it uses is smarter, although in this case I think it will produce the same result because it is the "best" rendering of the header under the circumstances. -- __

[issue35863] email.headers wraps headers badly

2019-01-31 Thread R. David Murray
R. David Murray added the comment: That is correct folding. The word is too long to fit within the 78 character default if put on the same line as the label, but does fit on a line by itself. If Outlook can't understand such a header it is even more broken than I thought it was :( You can

[issue35863] email.headers wraps headers badly

2019-01-30 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +email nosy: +barry, r.david.murray ___ Python tracker ___ ___ Python-bugs-list

[issue35863] email.headers wraps headers badly

2019-01-30 Thread Jon Ribbens
New submission from Jon Ribbens : email.headers can wrap headers by putting a FWS as the very first thing in the output: >>> from email.header import Header >>> Header("a" * 67, header_name="Content-ID").encode() '\n aaa' i.e. i