aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mailman_pgp/mta/bulk.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mailman_pgp/mta/bulk.py b/src/mailman_pgp/mta/bulk.py
index d22fec7..cd517e8 100644
--- a/src/mailman_pgp/mta/bulk.py
+++ b/src/mailman_pgp/mta/bulk.py
@@ -66,6 +66,9 @@ class PGPBulkMixin:
pgp_list = PGPMailingList.for_list(mlist)
if not pgp_list:
return
+ if not pgp_list.encrypt_outgoing and not pgp_list.sign_outgoing:
+ # nothing to do
+ return
keys = []
for recipient in recipients:
@@ -79,7 +82,6 @@ class PGPBulkMixin:
keys.append(pgp_address.key)
wrapped = MIMEWrapper(msg)
- out = msg
if pgp_list.sign_outgoing:
if pgp_list.encrypt_outgoing:
out = wrapped.sign_encrypt(pgp_list.key, pgp_list.pubkey,
@@ -87,11 +89,9 @@ class PGPBulkMixin:
else:
out = wrapped.sign(pgp_list.key)
else:
- if pgp_list.encrypt_outgoing:
- out = wrapped.encrypt(pgp_list.pubkey, *keys, throw_keyid=True)
+ out = wrapped.encrypt(pgp_list.pubkey, *keys, throw_keyid=True)
- if out is not msg:
- overwrite_message(out, msg)
+ overwrite_message(out, msg)
@public