forked from mirror/django-mailbox
fix message.text exception when attachment filename header contains weird characters
Add failing test for bad header character fix add comment
This commit is contained in:
parent
376bcff6bf
commit
488c726c2d
4 changed files with 339 additions and 2 deletions
|
|
@ -103,7 +103,7 @@ def get_body_from_message(message, maintype, subtype):
|
|||
"""
|
||||
body = ''
|
||||
for part in message.walk():
|
||||
if part.get('content-disposition', '').startswith('attachment;'):
|
||||
if convert_header_to_unicode(part.get('content-disposition', '')).startswith('attachment;'):
|
||||
continue
|
||||
if part.get_content_maintype() == maintype and \
|
||||
part.get_content_subtype() == subtype:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue