From fccec727a6c949b90e7646f7fdf1dbd6931e70ba Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Mon, 26 Jan 2015 13:04:54 -0600 Subject: If not signature don't fail --- mail/src/leap/mail/incoming/service.py | 2 +- mail/src/leap/mail/incoming/tests/test_incoming_mail.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/src/leap/mail/incoming/service.py b/mail/src/leap/mail/incoming/service.py index 0b2f7c2c..23c216ca 100644 --- a/mail/src/leap/mail/incoming/service.py +++ b/mail/src/leap/mail/incoming/service.py @@ -435,7 +435,7 @@ class IncomingMail(Service): def add_leap_header(ret): decrmsg, signkey = ret - if (senderAddress is None or + if (senderAddress is None or signkey is None or isinstance(signkey, keymanager_errors.KeyNotFound)): decrmsg.add_header( self.LEAP_SIGNATURE_HEADER, diff --git a/mail/src/leap/mail/incoming/tests/test_incoming_mail.py b/mail/src/leap/mail/incoming/tests/test_incoming_mail.py index 0745ee03..f8652b3b 100644 --- a/mail/src/leap/mail/incoming/tests/test_incoming_mail.py +++ b/mail/src/leap/mail/incoming/tests/test_incoming_mail.py @@ -46,6 +46,8 @@ from leap.soledad.common.crypto import ( ENC_SCHEME_KEY, ) +# TODO: add some tests for encrypted, unencrypted, signed and unsgined messages + class IncomingMailTestCase(TestCaseWithKeyManager): """ -- cgit v1.2.3