Skip to content

encoding.from_message incorrectly parses multi-line encoded headers #27

Description

@wolever
>>> msg = email.message_from_string("…")
>>> msg['Subject']
'=?ISO-8859-1?B?U2VuZCBkYQ==?=\n =?ISO-8859-1?B?dGEgZnJvbS==?='
>>> email.header.decode_header(msg['Subject'])
[('Send data from', 'iso-8859-1')] # The correct header
>>> clean_msg = lamson.encoding.from_message(msg)
>>> clean_msg['Subject']
u'Send da'  # Uh oh! Subject is getting truncated

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions