diff options
| author | J08nY | 2017-07-19 18:17:57 +0200 |
|---|---|---|
| committer | J08nY | 2017-07-19 18:17:57 +0200 |
| commit | c6dbc74b6abdc26698a5c76e7374d965d19632af (patch) | |
| tree | 1fbc2019d9ef9e117abf422d7fc089c9bee21820 /src | |
| parent | 4cb7d5309746a367f889c4a030c6232736554ef4 (diff) | |
| download | mailman-pgp-c6dbc74b6abdc26698a5c76e7374d965d19632af.tar.gz mailman-pgp-c6dbc74b6abdc26698a5c76e7374d965d19632af.tar.zst mailman-pgp-c6dbc74b6abdc26698a5c76e7374d965d19632af.zip | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/mailman_pgp/mta/bulk.py | 10 |
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 |
