1
0
Fork 1
mirror of https://github.com/coddingtonbear/django-mailbox.git synced 2026-07-09 22:38:19 +02:00

Fix text content with text attachment (#170)

* Add tests case for text content with text attachment

* Fix parsing text message with text attachment
This commit is contained in:
Adam Dobrawy 2018-02-09 09:13:39 +01:00 committed by Adam Coddington
parent dfad0f8f9c
commit 7eecb0d41d
2 changed files with 4 additions and 1 deletions

View file

@ -108,6 +108,8 @@ def get_body_from_message(message, maintype, subtype):
"""
body = six.text_type('')
for part in message.walk():
if part.get('content-disposition', '').startswith('attachment;'):
continue
if part.get_content_maintype() == maintype and \
part.get_content_subtype() == subtype:
charset = part.get_content_charset()