Commit b5443dd3 authored by ale's avatar ale

handle content-transfer-encoding: 8bit

parent ec981299
Pipeline #40 passed with stage
in 14 seconds
......@@ -154,7 +154,7 @@ def encode_base64(msg):
# 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 in [None, 'quoted-printable', 'x-uuencode', 'uue', 'x-uue']:
if encoding in [None, 'quoted-printable', 'x-uuencode', 'uue', 'x-uue', '8bit']:
orig = msg.get_payload(decode=True)
encdata = _bencode(orig)
......@@ -181,9 +181,14 @@ class TestMIME(TestBase):
def test_simple_text_message(self):
self._encrypt(MIMEText('test message'))
def test_utf8_text_message(self):
def test_base64_text_message(self):
self._encrypt(MIMEText(u'test message', 'plain', 'utf-8'))
def test_8bit_text_message(self):
m = MIMEText(u'test message')
m.replace_header('Content-Transfer-Encoding', '8bit')
def test_multipart_message_with_image(self):
msg = MIMEMultipart()
msg.preamble = 'This is a message with an image attachment'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment