Author iko
Recipients
Date 2004-06-18.12:50:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
text/* parts of email messages must use \r\n as the
newline separator. For unencoded messages. smtplib and
friends take care of the translation from \n to \r\n in
the SMTP processing.

Parts which are unencoded (i.e. 7bit character sets)
MUST use \n line endings, or smtplib with translate to
\r\r\n.

Parts that get encoded using quoted-printable can use
either, because the qp-encoder assumes input data is
text and reencodes with \n.

However, parts which get encoded using base64 are NOT
translated, and so must use \r\n line endings.

This means you have to guess whether your text is going
to get encoded or not (admittedly, usually not that
hard), and translate the line endings appropriately
before generating a Message instance.

I think the fix would be for Charset.encode_body() to
alway force the encoder to text mode
(i.e.binary=False), since it seems unlikely to have a
Charset for something which is not text.
History
Date User Action Args
2007-08-23 14:22:42adminlinkissue975330 messages
2007-08-23 14:22:42admincreate