summaryrefslogtreecommitdiff
path: root/mail/src
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-01-21 16:32:24 -0200
committerdrebs <drebs@leap.se>2014-01-21 16:51:52 -0200
commite99af33d1cefe4797f72b4939bf775348df2586e (patch)
tree733074ffd0dcbccf7dd2ee5480931ae0264c1926 /mail/src
parent8a7492940f23b6308f15f8f11b960702e00f3684 (diff)
Restrict adding outgoing footer to text/plain messages.
Diffstat (limited to 'mail/src')
-rw-r--r--mail/src/leap/mail/smtp/gateway.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/mail/src/leap/mail/smtp/gateway.py b/mail/src/leap/mail/smtp/gateway.py
index bef5c6d..ef398d1 100644
--- a/mail/src/leap/mail/smtp/gateway.py
+++ b/mail/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