I'm trying to use the email package (4.x) as the underpinning for an
IMAP server.  As part of this, I need to send each line of the message
from the server to the client with a CR-LF attached.  My mail is in
files with CR-LF as line separators.  I create a Message from
"open(message_path_name, 'rb')".  I then call "as_string", and get the
message back with only LF.  Looking at the code, I see that the
default header-printing methods in Generator just call "print" (which
strikes me as a bad idea), and get the default newline handling, which
the body-printing calls file.write(), and gets whatever get_payload()
returned, and I don't see why this doesn't preserve CR-LF pairs in the
file.

So:  how can Generator.flatten(), or as_string(), be fixed to specify
CR-LF line endings for each line?

Bill
_______________________________________________
Email-SIG mailing list
[email protected]
Your options: 
http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com

Reply via email to