aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/mta
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman_pgp/mta')
-rw-r--r--src/mailman_pgp/mta/deliver.py2
-rw-r--r--src/mailman_pgp/mta/tests/test_deliver.py6
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,