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.

classification
Title: email library Parser can't parse some messages
Type: Stage:
Components: Library (Lib) Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, ondrejj
Priority: normal Keywords:

Created on 2004-02-12 07:42 by ondrejj, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.eml ondrejj, 2004-02-12 07:45 an example
Messages (3)
msg19967 - (view) Author: Jan Ondrej (ondrejj) Date: 2004-02-12 07:42
The email library can't decode some emails with one bad
part. This part is ignored (not decoded) by other
software. I am developing an antivir software and I
need to decode these messages.

There is the code, which raises an error:
  if line[0] in ' \t':
      if not lastheader:
        print "Errors.HeaderParseError"
            raise Errors.HeaderParseError(
                      'Continuation line seen before
first header')

There is an example attached. It contains a space
before "Content-Type:" in first part. This part is
buggy, but next part can contain important data.

If it is not a bug but an RFC implementation, please
tell me, how I can decode these emails.

I think, this problem is in all versions of this
library (also in CVS), because this code is not changed
in it.
msg19968 - (view) Author: Jan Ondrej (ondrejj) Date: 2004-02-12 07:45
Logged In: YES 
user_id=799485

I am sorry, file was not attached.
msg19969 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-05-09 17:20
Logged In: YES 
user_id=12800

Sorry, but that's a limitation of the design of the email2
Parser.  You should probably have a look at the email3
FeedParser which will parse the sample message, adding
'defects' for the bogus headers.

email3 will be part of Python 2.4.  Please join the
email-sig if you want to contribute to the design. 
http://www.python.org/sigs/email-sig
History
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39928
2004-02-12 07:42:30ondrejjcreate