aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/commands/eml_key.py
diff options
context:
space:
mode:
authorJ08nY2017-07-26 22:31:40 +0200
committerJ08nY2017-07-26 22:31:40 +0200
commit800dd99fe45cf1ff2611fd115936d3113516d342 (patch)
tree99f0c1bf256bc13d0580816ce7dcc5a89e2a6224 /src/mailman_pgp/commands/eml_key.py
parent13055e265c738be43c0a4cb4c2898939cd0c1cd5 (diff)
downloadmailman-pgp-800dd99fe45cf1ff2611fd115936d3113516d342.tar.gz
mailman-pgp-800dd99fe45cf1ff2611fd115936d3113516d342.tar.zst
mailman-pgp-800dd99fe45cf1ff2611fd115936d3113516d342.zip
Diffstat (limited to 'src/mailman_pgp/commands/eml_key.py')
-rw-r--r--src/mailman_pgp/commands/eml_key.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mailman_pgp/commands/eml_key.py b/src/mailman_pgp/commands/eml_key.py
index 0437430..e792fa4 100644
--- a/src/mailman_pgp/commands/eml_key.py
+++ b/src/mailman_pgp/commands/eml_key.py
@@ -183,6 +183,16 @@ def _cmd_change(pgp_list, mlist, msg, msgdata, arguments, results):
file=results)
return ContinueProcessing.no
+ email = get_email(msg)
+ if not email:
+ print('No email to change key of.', file=results)
+ return ContinueProcessing.no
+
+ pgp_address = PGPAddress.for_email(email)
+ if pgp_address is None:
+ print('A pgp enabled address not found.', file=results)
+ return ContinueProcessing.no
+
wrapped = PGPWrapper(msg)
if wrapped.is_encrypted():
decrypted = wrapped.decrypt(pgp_list.key)
@@ -197,16 +207,6 @@ def _cmd_change(pgp_list, mlist, msg, msgdata, arguments, results):
print('More than one key! Send only one key.', file=results)
return ContinueProcessing.no
- email = get_email(msg)
- if not email:
- print('No email to change key of.', file=results)
- return ContinueProcessing.no
-
- pgp_address = PGPAddress.for_email(email)
- if pgp_address is None:
- print('A pgp enabled address not found.', file=results)
- return ContinueProcessing.no
-
workflow = KeyChangeWorkflow(mlist, pgp_address, keys.pop())
list(workflow)
print('Key change request received.', file=results)