From 0ec7027662b6fda1c9969846e6a937e9f98cc7b7 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 15 Aug 2017 18:35:48 +0200 Subject: [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 --- src/leap/bitmask/mail/outgoing/service.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask/mail/outgoing') 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 -- cgit v1.2.3