summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
Diffstat (limited to 'alot')
-rw-r--r--alot/commands/envelope.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index ccdbae65..cc549953 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -498,6 +498,14 @@ class EncryptCommand(Command):
encrypt = not envelope.encrypt
envelope.encrypt = encrypt
if encrypt:
+ if not self.encrypt_keys:
+ for recipient in envelope.headers['To'][0].split(','):
+ match = re.search("<(.*@.*)>", recipient)
+ if match:
+ recipient = match.group(0)
+ self.encrypt_keys.append(recipient)
+
+ logging.debug("encryption keys: " + str(self.encrypt_keys))
try:
# cache all keys before appending to envelope, since otherwise
# we get an error message but all earlier keys are added, but