From 5be02926efeb775e652c217ade02250b0cc7e3ca 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. --- keymanager/src/leap/keymanager/openpgp.py | 1 - 1 file changed, 1 deletion(-) (limited to 'keymanager') diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py index f6223d57..0c11d17b 100644 --- a/keymanager/src/leap/keymanager/openpgp.py +++ b/keymanager/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 dd85ddd5e45b86e60e2d346ead3d09deccbef0ed 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'. --- keymanager/src/leap/keymanager/openpgp.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'keymanager') diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py index 0c11d17b..cb46371c 100644 --- a/keymanager/src/leap/keymanager/openpgp.py +++ b/keymanager/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 c9065eccaaed40d053d16afc9cea14e122e60fe0 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. --- keymanager/changes/email-checks | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 keymanager/changes/email-checks (limited to 'keymanager') diff --git a/keymanager/changes/email-checks b/keymanager/changes/email-checks new file mode 100644 index 00000000..eee7de75 --- /dev/null +++ b/keymanager/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