Skip to content

Commit

Permalink
Merge branch 'hotfix/2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fedelemantuano committed Oct 12, 2017
2 parents 9463fb9 + 0e34dba commit b58e298
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 3 additions & 11 deletions mailparser/mailparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,11 @@ def parse(self):
transfer_encoding = ported_string(
p.get('content-transfer-encoding', '')).lower()

if transfer_encoding in ("base64"):
if transfer_encoding == "base64" or \
(transfer_encoding == "quoted-printable" and
"application" in mail_content_type):
payload = p.get_payload(decode=False)
binary = True
elif transfer_encoding in ("quoted-printable"):
d = p.get_payload(decode=True)
e = p.get_payload(decode=False)

# In this case maybe is a binary with malformed base64
if d == e:
payload = e
binary = True
else:
payload = ported_string(d, encoding=charset)
else:
payload = ported_string(
p.get_payload(decode=True), encoding=charset)
Expand Down
2 changes: 1 addition & 1 deletion mailparser/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
limitations under the License.
"""

__version__ = "2.0.0"
__version__ = "2.0.1"

if __name__ == "__main__":
print(__version__)

0 comments on commit b58e298

Please sign in to comment.