This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2006年10月06日 01:30 by andrzejl, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg30173 - (view) | Author: Andy Leszczynski (andrzejl) | Date: 2006年10月06日 01:30 | |
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'] = '...@a.b' msg['To'] = '...@x.y' 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: a...@a.b\nTo: c...@x.y\n\n--===============1018679223==\nContent-Type: text/plain; charset="us-ascii"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\n\naaaaaaaaaaaaaaaaaaaaaaaa\n--===============1018679223==--\n' Found in version 2.3 and 2.4 |
|||
| msg68642 - (view) | Author: Deron Meranda (dmeranda) | Date: 2008年06月23日 17:44 | |
Still an issue in 2.5. This lack of conformance to the RFC is can also cause problems when trying to use encrypted or signed email, as those activities may depend on "canonical" line endings. An LF rather than CR+LF can cause the crypto to break in some cases. This appears to be caused by the email package writing to an internal StringIO file using the print statement, where it relies on print outputting the end-of-line character (which will always output a LF). The module should instead write the eol character(s) explicitly. To maintain backwards compatibility, it may be best if the preferred eol character be settable on a per-message basis; which would default to the current non-conforming behavior of LF, but which could be set to CR+LF if strict MIME behavior is desired. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:20 | admin | set | github: 44089 |
| 2010年01月13日 15:18:54 | r.david.murray | set | status: open -> closed |
| 2010年01月12日 02:07:17 | r.david.murray | set | resolution: duplicate superseder: email.Generator does not separate headers with "\r\n" stage: resolved |
| 2008年06月23日 17:44:54 | dmeranda | set | nosy:
+ dmeranda type: behavior messages: + msg68642 |
| 2006年10月06日 01:30:57 | andrzejl | create | |