From 3cafd7ef3f6578a3f45d0b0218b8ca6d388be6d3 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 21 Nov 2013 12:12:31 -0300 Subject: Do not check for a valid address, rely on client. An email address regexp that supports all (or almost) emails is really complex, and is_address uses a simpler one since we restrict the valid usernames and provider names. For that we rely on the email client to check whether the email address is valid or not. --- src/leap/keymanager/openpgp.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py index f6223d5..0c11d17 100644 --- a/src/leap/keymanager/openpgp.py +++ b/src/leap/keymanager/openpgp.py @@ -297,7 +297,6 @@ class OpenPGPScheme(EncryptionScheme): :rtype: OpenPGPKey @raise KeyNotFound: If the key was not found on local storage. """ - leap_assert(is_address(address), 'Not an user address: %s' % address) doc = self._get_key_doc(address, private) if doc is None: raise errors.KeyNotFound(address) -- cgit v1.2.3 From bf5ce4086647ddf8381b0e75e928c1f675b0cddf Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 21 Nov 2013 12:23:33 -0300 Subject: Remove '+' suffix in email address. This allows us to support encrypt mails to 'test_user@provider.com' even if was sent to 'test_user+optional_string@provider.com'. --- src/leap/keymanager/openpgp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/leap/keymanager/openpgp.py b/src/leap/keymanager/openpgp.py index 0c11d17..cb46371 100644 --- a/src/leap/keymanager/openpgp.py +++ b/src/leap/keymanager/openpgp.py @@ -297,6 +297,11 @@ class OpenPGPScheme(EncryptionScheme): :rtype: OpenPGPKey @raise KeyNotFound: If the key was not found on local storage. """ + # Remove the identity suffix after the '+' until the '@' + # e.g.: test_user+something@provider.com becomes test_user@probider.com + # since the key belongs to the identity without the '+' suffix. + address = re.sub(r'\+.*\@', '@', address) + doc = self._get_key_doc(address, private) if doc is None: raise errors.KeyNotFound(address) -- cgit v1.2.3 From 146948c060c1f69b997400e995ec9d4ba4160c56 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 21 Nov 2013 12:30:14 -0300 Subject: Add changes file for #4491. --- changes/email-checks | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changes/email-checks diff --git a/changes/email-checks b/changes/email-checks new file mode 100644 index 0000000..eee7de7 --- /dev/null +++ b/changes/email-checks @@ -0,0 +1,3 @@ + o Remove address check when sending email and rely in the email client to + verify that is correct. Closes #4491. + o Support sending encrypted mails to addresses using the '+' sign. -- cgit v1.2.3