summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--alot/commands/envelope.py4
-rw-r--r--tests/commands/envelope_test.py1
2 files changed, 2 insertions, 3 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index a9cfac74..0294dc01 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -505,8 +505,8 @@ class SignCommand(Command):
return
else:
try:
- acc = settings.get_account_by_address(
- envelope.headers['From'][0])
+ _, addr = email.utils.parseaddr(envelope.headers['From'][0])
+ acc = settings.get_account_by_address(addr)
except NoMatchingAccount:
envelope.sign = False
ui.notify('Unable to find a matching account',
diff --git a/tests/commands/envelope_test.py b/tests/commands/envelope_test.py
index 51148dcc..37ea9eed 100644
--- a/tests/commands/envelope_test.py
+++ b/tests/commands/envelope_test.py
@@ -337,7 +337,6 @@ class TestSignCommand(unittest.TestCase):
self.assertTrue(env.sign)
self.assertIs(env.sign_key, mock.sentinel.gpg_key)
- @unittest.expectedFailure
def test_apply_from_user_and_email(self):
"""This tests that a gpg key can be derived using a 'From' header that
contains a realname-email combo.