Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core


Commits:
beb6b2d4 by Mark Sapiro at 2023-01-07T22:35:01+00:00
Add cleanse-dkim handler to default owner pipeline.

Fixes #1053

- - - - -
3f6ac24e by Mark Sapiro at 2023-01-07T22:35:01+00:00
Merge branch 'cleanse' into 'master'

Add cleanse-dkim handler to default owner pipeline.

Closes #1053

See merge request mailman/mailman!1092
- - - - -


3 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/pipelines/builtin.py
- src/mailman/runners/tests/test_pipeline.py


Changes:

=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -20,6 +20,11 @@ Configuration
   different logging formats. This should fix suprious errors with
   ``KeyError: t`` that was often confusing for users. (Fixes #1049)
 
+Bugs fixed
+----------
+* ``config.mta.remove_dkim_headers`` now applies to messages to -owner.
+  (Closes #1053)
+
 .. _news-3.3.8:
 
 3.3.8


=====================================
src/mailman/pipelines/builtin.py
=====================================
@@ -30,6 +30,7 @@ class OwnerPipeline(BasePipeline):
     description = _('The built-in owner pipeline.')
 
     _default_handlers = (
+        'cleanse-dkim',
         'owner-recipients',
         'to-outgoing',
         )


=====================================
src/mailman/runners/tests/test_pipeline.py
=====================================
@@ -25,6 +25,8 @@ from mailman.interfaces.handler import IHandler
 from mailman.interfaces.pipeline import IPipeline
 from mailman.runners.pipeline import PipelineRunner
 from mailman.testing.helpers import (
+    configuration,
+    get_queue_messages,
     make_testable_runner,
     specialized_message_from_string as mfs,
 )
@@ -105,3 +107,15 @@ To: t...@example.com
         self._pipeline.run()
         self.assertEqual(len(self._markers), 1)
         self.assertEqual(self._markers[0], 'owner')
+
+    def test_cleanse_owner(self):
+        # The owner pipeline honors remove_dkim_headers.
+        msgdata = dict(listid='test.example.com',
+                       to_owner=True)
+        self._msg['DKIM-Signature'] = 'just testing'
+        self._mlist.owner_pipeline = 'default-owner-pipeline'
+        config.switchboards['pipeline'].enqueue(self._msg, msgdata)
+        with configuration('mta', remove_dkim_headers='yes'):
+            self._pipeline.run()
+        item = get_queue_messages('out', expected_count=1)[0]
+        self.assertIsNone(item.msg.get('DKIM-Signature'))



View it on GitLab: 
https://gitlab.com/mailman/mailman/-/compare/0ab9c57368f7e9c47b959529babd028f632873d1...3f6ac24e6c1c7ab6daa4b35f4bb8f1556303e254

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/-/compare/0ab9c57368f7e9c47b959529babd028f632873d1...3f6ac24e6c1c7ab6daa4b35f4bb8f1556303e254
You're receiving this email because of your account on gitlab.com.


_______________________________________________
Mailman-checkins mailing list -- mailman-checkins@python.org
To unsubscribe send an email to mailman-checkins-le...@python.org
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: arch...@jab.org

Reply via email to