summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-01-23 15:37:11 -0300
committerTomás Touceda <chiiph@leap.se>2014-01-23 15:37:11 -0300
commit70c77b2cb9a36fd6d0630daef3e442e45c43c0a2 (patch)
tree2e45647bf2734cefb46148ce75acbf62e30ae2b8 /mail
parentfa4d9274f04d22ce620976148b8cef74e8085d39 (diff)
parentb3203b064bf59d12240687e2317c6d88d9f14b8d (diff)
Merge remote-tracking branch 'refs/remotes/drebs/handle-outgoing-base64-encoded-attachments' into develop
Diffstat (limited to 'mail')
-rw-r--r--mail/src/leap/mail/smtp/rfc3156.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mail/src/leap/mail/smtp/rfc3156.py b/mail/src/leap/mail/smtp/rfc3156.py
index 2c6d4a7..62a0675 100644
--- a/mail/src/leap/mail/smtp/rfc3156.py
+++ b/mail/src/leap/mail/smtp/rfc3156.py
@@ -147,14 +147,15 @@ def encode_base64(msg):
:type msg: email.message.Message
"""
encoding = msg.get('Content-Transfer-Encoding', None)
+ if encoding is not None:
+ encoding = encoding.lower()
# XXX Python's email module can only decode quoted-printable, base64 and
# uuencoded data, so we might have to implement other decoding schemes in
# order to support RFC 3156 properly and correctly calculate signatures
# for multipart attachments (eg. 7bit or 8bit encoded attachments). For
# now, if content is already encoded as base64 or if it is encoded with
# some unknown encoding, we just pass.
- if encoding is None or encoding.lower() in ['quoted-printable',
- 'x-uuencode', 'uue', 'x-uue']:
+ if encoding in [None, 'quoted-printable', 'x-uuencode', 'uue', 'x-uue']:
orig = msg.get_payload(decode=True)
encdata = _bencode(orig)
msg.set_payload(encdata)