diff options
| author | J08nY | 2017-08-04 00:31:13 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-04 00:31:13 +0200 |
| commit | 4e4f91d64e32ccd601cb86fbb2a30bf3db3acf24 (patch) | |
| tree | f7314a0990159d0c0c7123620083d648fc828744 /src/mailman_pgp/mta | |
| parent | d615ae7d93356ba9dfda0348db6a011ad1d24bdc (diff) | |
| download | mailman-pgp-4e4f91d64e32ccd601cb86fbb2a30bf3db3acf24.tar.gz mailman-pgp-4e4f91d64e32ccd601cb86fbb2a30bf3db3acf24.tar.zst mailman-pgp-4e4f91d64e32ccd601cb86fbb2a30bf3db3acf24.zip | |
Diffstat (limited to 'src/mailman_pgp/mta')
| -rw-r--r-- | src/mailman_pgp/mta/deliver.py | 2 | ||||
| -rw-r--r-- | src/mailman_pgp/mta/tests/test_deliver.py | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mailman_pgp/mta/deliver.py b/src/mailman_pgp/mta/deliver.py index 050a740..ef4713a 100644 --- a/src/mailman_pgp/mta/deliver.py +++ b/src/mailman_pgp/mta/deliver.py @@ -50,7 +50,7 @@ def deliver(mlist, msg, msgdata): bulk_agent = BulkDelivery pgp_list = PGPMailingList.for_list(mlist) - if pgp_list: + if pgp_list and msgdata.get('pgp_is_posting', False): personalized_agent = PGPPersonalizedDelivery bulk_agent = PGPBulkDelivery diff --git a/src/mailman_pgp/mta/tests/test_deliver.py b/src/mailman_pgp/mta/tests/test_deliver.py index 3b0594f..3406d02 100644 --- a/src/mailman_pgp/mta/tests/test_deliver.py +++ b/src/mailman_pgp/mta/tests/test_deliver.py @@ -72,13 +72,15 @@ Some text. """) def test_deliver(self): - msgdata = dict(recipients=['anne@example.org', 'bart@example.org']) + msgdata = dict(recipients=['anne@example.org', 'bart@example.org'], + pgp_is_posting=True) deliver(self.mlist, self.msg, msgdata) def test_deliver_no_key(self): with transaction(): self.pgp_anne.key = None - msgdata = dict(recipients=['anne@example.org', 'bart@example.org']) + msgdata = dict(recipients=['anne@example.org', 'bart@example.org'], + pgp_is_posting=True) with self.assertRaises(SomeRecipientsFailed) as err: deliver(self.mlist, self.msg, msgdata) self.assertEqual(err.exception.temporary_failures, |
