Skip to content

Commit

Permalink
Merge pull request #28 from stevenhair/bugfixes
Browse files Browse the repository at this point in the history
Support for plaintext attachments
  • Loading branch information
keitaoouchi committed Mar 14, 2016
2 parents 0f98008 + 714c20a commit 0926ab9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions easyimap/easyimap.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ def attachments(self):
for part in self._message.walk():
if part.get_content_maintype() == 'multipart':
continue
if part.get('Content-Disposition') is None:
continue
if part.get_filename():
filename = part.get_filename()
if not filename:
Expand Down Expand Up @@ -215,7 +213,9 @@ def _decode_header(data):
decoded_headers = decode_header(data)
headers = []
for decoded_str, charset in decoded_headers:
if charset:
if isinstance(decoded_str, unicode):
headers.append(decoded_str)
elif charset:
headers.append(unicode(decoded_str, charset))
else:
encoding = chardet.detect(decoded_str)
Expand Down

0 comments on commit 0926ab9

Please sign in to comment.