summaryrefslogtreecommitdiff
path: root/alot/commands/globals.py
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2012-05-17 15:47:23 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2012-05-17 15:47:23 +0100
commit08c2ee1d88e69aa5df27b74d1cebd3c0c8be68f6 (patch)
tree2dde7d7db9146918242f2c289c64e587706b3f09 /alot/commands/globals.py
parent138f13c682f6a63da67cced1f0c267b5f6f349b8 (diff)
parent56b0b8a0f310403d4664649ab9b69d3cd765dbe5 (diff)
Merge branch '0.3-feature-pyme' into staging
Conflicts: alot/settings/__init__.py alot/settings/checks.py docs/source/generate_configs.py
Diffstat (limited to 'alot/commands/globals.py')
-rw-r--r--alot/commands/globals.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/alot/commands/globals.py b/alot/commands/globals.py
index b0956ddb..65609996 100644
--- a/alot/commands/globals.py
+++ b/alot/commands/globals.py
@@ -17,12 +17,14 @@ from alot.commands import commandfactory
from alot import buffers
from alot import widgets
from alot import helper
+from alot import crypto
from alot.db.errors import DatabaseLockedError
from alot.completion import ContactsCompleter
from alot.completion import AccountCompleter
from alot.db.envelope import Envelope
from alot import commands
from alot.settings import settings
+from alot.errors import GPGProblem
MODE = 'global'
@@ -596,12 +598,16 @@ class ComposeCommand(Command):
select='yes', cancel='no')) == 'no':
return
+ # Figure out whether we should GPG sign messages by default
+ # and look up key if so
+ 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
+
# get missing To header
if 'To' not in self.envelope.headers:
- sender = self.envelope.get('From')
- name, addr = email.Utils.parseaddr(sender)
- account = settings.get_account_by_address(addr)
-
allbooks = not settings.get('complete_matching_abook_only')
logging.debug(allbooks)
if account is not None: