Hi,

according to rfc2046, line breaks in MIME are CRLF. However python just 
uses LF like in the following example:


from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText

msg = MIMEMultipart()
msg['Subject'] = 'Our family reunion'
msg['From'] = '[EMAIL PROTECTED]'
msg['To'] = '[EMAIL PROTECTED]'
msg.epilogue = ''

msg.attach(MIMEText('aaaaaaaaaaaaaaaaaaaaaaaa'))

print `msg.as_string()`


gives:
'Content-Type: multipart/mixed; 
boundary="===============1018679223=="\nMIME-Version: 1.0\nSubject: Our 
family reunion\nFrom: [EMAIL PROTECTED]: 
[EMAIL PROTECTED]: text/plain; 
charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 
7bit\n\naaaaaaaaaaaaaaaaaaaaaaaa\n--===============1018679223==--\n'



Any insight why does it not stick to standard. I also checked parsing 
and it seems to accept both CRLF and LF.

-- 
Thx, alfz1
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to