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.

Author mkaiser
Recipients barry, mkaiser, r.david.murray
Date 2019-12-13.16:59:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm working on a mailfilter in python and used the method "get_filename" of the "EmailMessage" class.

In some cases a wrong filename was returned. The reason was, that the Content-Disposition Header had a line break and the following intention was interpreted as part of the filename.

After fixing this bug, I was able to get the right filename.

I had to change "linesep_splitter" in "email.policy" to match the intention.

Old Value:

linesep_splitter = re.compile(r'\n|\r')

New Value:

linesep_splitter = re.compile(r'\n\s+|\r\s+')
Date User Action Args
2019-12-13 16:59:51mkaisersetrecipients: + mkaiser, barry, r.david.murray
2019-12-13 16:59:51mkaisersetmessageid: <>
2019-12-13 16:59:51mkaiserlinkissue39040 messages
2019-12-13 16:59:51mkaisercreate