Regards.
The problem is this code:
[color=blue][color=green][color=darkred]
>>> import email.Message
>>> msg = email.Message.M essage()
>>> msg["subject"] = "email bug"
>>> msg["from"] = "Manlio Perillo"
>>> print repr(msg.as_str ing())[/color][/color][/color]
'subject: email bug\nfrom: Manlio Perillo\n\n'
Why line ending is '\n' and not '\r\n' ?
RFC 2822 says that the delimiter must(?) be '\r\n'.
The same problem is presente in email.Generator and email.Header (for
multiline headers).
P.S.
email.Header has a bug:
this code causes an infinite recursion:
[color=blue][color=green][color=darkred]
>>> from email.Header import Header
>>> h = Header('multili ne header', 'iso-8859-1', maxlinelen=4)
>>> e.encode()[/color][/color][/color]
Manlio Perillo
The problem is this code:
[color=blue][color=green][color=darkred]
>>> import email.Message
>>> msg = email.Message.M essage()
>>> msg["subject"] = "email bug"
>>> msg["from"] = "Manlio Perillo"
>>> print repr(msg.as_str ing())[/color][/color][/color]
'subject: email bug\nfrom: Manlio Perillo\n\n'
Why line ending is '\n' and not '\r\n' ?
RFC 2822 says that the delimiter must(?) be '\r\n'.
The same problem is presente in email.Generator and email.Header (for
multiline headers).
P.S.
email.Header has a bug:
this code causes an infinite recursion:
[color=blue][color=green][color=darkred]
>>> from email.Header import Header
>>> h = Header('multili ne header', 'iso-8859-1', maxlinelen=4)
>>> e.encode()[/color][/color][/color]
Manlio Perillo
Comment