From 9347da67f253a697f5a1c3bd380263f61c62abed Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 21 Jan 2014 16:32:24 -0200 Subject: Restrict adding outgoing footer to text/plain messages. --- ...g_restrict-adding-outgoing-footer-to-text-plain-messages | 1 + src/leap/mail/smtp/gateway.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 changes/bug_restrict-adding-outgoing-footer-to-text-plain-messages diff --git a/changes/bug_restrict-adding-outgoing-footer-to-text-plain-messages b/changes/bug_restrict-adding-outgoing-footer-to-text-plain-messages new file mode 100644 index 0000000..9983404 --- /dev/null +++ b/changes/bug_restrict-adding-outgoing-footer-to-text-plain-messages @@ -0,0 +1 @@ + o Restrict adding outgoing footer to text/plain messages. diff --git a/src/leap/mail/smtp/gateway.py b/src/leap/mail/smtp/gateway.py index bef5c6d..ef398d1 100644 --- a/src/leap/mail/smtp/gateway.py +++ b/src/leap/mail/smtp/gateway.py @@ -600,13 +600,16 @@ class EncryptedMessage(object): self._msg = self._origmsg return - # add a nice footer to the outgoing message from_address = validate_address(self._fromAddress.addrstr) username, domain = from_address.split('@') - self.lines.append('--') - self.lines.append('%s - https://%s/key/%s' % - (self.FOOTER_STRING, domain, username)) - self.lines.append('') + + # add a nice footer to the outgoing message + if self._origmsg.get_content_type() == 'text/plain': + self.lines.append('--') + self.lines.append('%s - https://%s/key/%s' % + (self.FOOTER_STRING, domain, username)) + self.lines.append('') + self._origmsg = self.parseMessage() # get sender and recipient data -- cgit v1.2.3