summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/mail/outgoing
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-08-15 18:35:48 +0200
committerKali Kaneko <kali@leap.se>2017-08-15 16:59:17 -0400
commit0ec7027662b6fda1c9969846e6a937e9f98cc7b7 (patch)
treee4bab736c5bade9e07310a78484777f4697e37aa /src/leap/bitmask/mail/outgoing
parent8cabb28ee22131934c5cc59e96019771801b7f6d (diff)
[bug] encode pgp/mime parts as 7bit encoding
We were encoding some parts as base64 and others with our manual encoders. Let's not do base64 and use the email standard library encoders instead. - Resolves: #8957
Diffstat (limited to 'src/leap/bitmask/mail/outgoing')
-rw-r--r--src/leap/bitmask/mail/outgoing/service.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/leap/bitmask/mail/outgoing/service.py b/src/leap/bitmask/mail/outgoing/service.py
index a3b8d005..86fb63c2 100644
--- a/src/leap/bitmask/mail/outgoing/service.py
+++ b/src/leap/bitmask/mail/outgoing/service.py
@@ -26,6 +26,7 @@ import re
from StringIO import StringIO
from copy import deepcopy
from email.parser import Parser
+from email.encoders import encode_7or8bit
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@@ -385,7 +386,7 @@ class OutgoingMail(object):
def create_encrypted_message(res):
newmsg, encstr = res
encmsg = MIMEApplication(
- encstr, _subtype='octet-stream', _encoder=lambda x: x)
+ encstr, _subtype='octet-stream', _encoder=encode_7or8bit)
encmsg.add_header('content-disposition', 'attachment',
filename='msg.asc')
# create meta message