problem with internationalized headers in email package

Manlio Perillo manlio_perilloNO at
Sun Jun 29 13:30:59 CEST 2008


>From RFC 2047:
+ An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'.
+ An 'encoded-word' MUST NOT appear within a 'quoted-string'.
+ An 'encoded-word' MUST NOT be used in a Received header field.
+ An 'encoded-word' MUST NOT be used in parameter of a MIME
  Content-Type or Content-Disposition field, or in any structured
  field body except within a 'comment' or 'phrase'.

However (Python 2.5.2):

>>> h = Header(u'Andrè <andre at localhost>')
>>> h.encode()

I'm not sure if this can be considered a bug, but surely this is an 
invalid header.

Thanks  Manlio Perillo

More information about the Python-list mailing list