summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-05-19 18:42:46 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-05-19 18:42:46 +0100
commit4adf381b3407098ca7f533f3027dba7a77dfa943 (patch)
tree9c6f0f7a2e65645d293b8c580ab4e58c444156ed /alot
parent6cbace46c2d0e37b1da18d4abe08f1b6e4c454e0 (diff)
fix editnew
... if used on a mail with sender's address not being one's own: In that case, settings.get_account_by_address(addr) returns None. cf issue #451
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/globals.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index 65609996..36e99207 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -603,8 +603,9 @@ class ComposeCommand(Command):
sender = self.envelope.get('From')
name, addr = email.Utils.parseaddr(sender)
account = settings.get_account_by_address(addr)
- self.envelope.sign = account.sign_by_default
- self.envelope.sign_key = account.gpg_key
+ if account:
+ self.envelope.sign = account.sign_by_default
+ self.envelope.sign_key = account.gpg_key
# get missing To header
if 'To' not in self.envelope.headers: