summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorJohannes Kulick <kulick@hildensia.de>2012-12-15 15:06:37 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2013-02-19 10:10:07 +0000
commit2fd83f8064fa974964f1ed304f366089c673f4a0 (patch)
tree5b4a1a1b9cb7d839bee544e9e247c0f00bd4ce1e /alot
parent6db4ecfb75ec1969426adbb154bbb3ccbded6b1a (diff)
automatically fill in recipients as encryption recipients
if the user doesn't supply encrypt with a list of encryption keys, the email addresses of the email recipients are used
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