
Hi Barry! I've had some problems with messages which doesn't follow the RFC when regarding to parameter building. More specificaly, I've found the following header in a message (in one line): Content-Type: multipart/mixed; boundary = b71528a4d486932a8bdd3c50d1048d7c7 This breaks the email package because, following the RFC, there should be no spaces surrounding the "=" symbol, and the Message class, as expected, breaks this spliting in "=". OTOH, the RFC defines parameters as follows: parameter := attribute "=" value attribute := token ; Matching of attributes ; is ALWAYS case-insensitive. value := token / quoted-string token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, or tspecials> So, there's no chance of finding a space surrounding "=", unless the parameter is not written as defined in the RFC. Thus, it's safe to strip the name and value fields. If you choose to keep following the RFC strictly, I'll understand. OTOH, parsing bad written headers safely would be nice as well. I can send a patch, if necessary. Thanks! -- Gustavo Niemeyer [ 2AAC 7928 0FBF 0299 5EB5 60E2 2253 B29A 6664 3A0C ]

Never mind. I've just read your announce: --- - More liberal acceptance of parameter formatting, e.g. this is now accepted: Content-Type: multipart/mixed; boundary = "FOO" I.e. spaces around the = sign. --- Thank you! -- Gustavo Niemeyer [ 2AAC 7928 0FBF 0299 5EB5 60E2 2253 B29A 6664 3A0C ]

"GN" == Gustavo Niemeyer <niemeyer@conectiva.com> writes:
GN> - More liberal acceptance of parameter formatting, GN> e.g. this is now accepted: Content-Type: multipart/mixed; GN> boundary = "FOO" I.e. spaces around the = sign. GN> Thank you! No problem! :) BTW, this was part of email 1.2 which was released 18-Mar-2002. Current cvs is as 2.0 which has some API changes (with the proper DeprecationWarnings <wink>) and will likely be folded into Python 2.3. -Barry

Never mind. I've just read your announce: --- - More liberal acceptance of parameter formatting, e.g. this is now accepted: Content-Type: multipart/mixed; boundary = "FOO" I.e. spaces around the = sign. --- Thank you! -- Gustavo Niemeyer [ 2AAC 7928 0FBF 0299 5EB5 60E2 2253 B29A 6664 3A0C ]

"GN" == Gustavo Niemeyer <niemeyer@conectiva.com> writes:
GN> - More liberal acceptance of parameter formatting, GN> e.g. this is now accepted: Content-Type: multipart/mixed; GN> boundary = "FOO" I.e. spaces around the = sign. GN> Thank you! No problem! :) BTW, this was part of email 1.2 which was released 18-Mar-2002. Current cvs is as 2.0 which has some API changes (with the proper DeprecationWarnings <wink>) and will likely be folded into Python 2.3. -Barry
participants (2)
-
barry@zope.com
-
Gustavo Niemeyer