Content type not passed to encrypted submime causing bug where is only html is sent for example, the email client will not decode the html before displaying the email.
This commit is contained in:
TheGreatGooo 2017-09-09 11:53:00 -04:00 committed by GitHub
parent ba0953a372
commit 29f902b27c
1 changed files with 4 additions and 1 deletions

View File

@ -437,7 +437,10 @@ def encrypt_all_payloads_mime( message, gpg_to_cmdline ):
# it's skipping an imaginary blank line someplace. (ie skipping a header)
# Workaround it here by prepending a blank line.
# This happens only on text only messages.
submsg2.set_payload("\n" + message.get_payload(decode=True))
additionalSubHeader=""
if message.has_key('Content-Type') and not message['Content-Type'].startswith('multipart'):
additionalSubHeader="Content-Type: "+message['Content-Type']+"\n"
submsg2.set_payload(additionalSubHeader+"\n" +message.get_payload(decode=True))
check_nested = True
else:
processed_payloads = generate_message_from_payloads(message)