Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core
Commits: 6f9761f3 by Mark Sapiro at 2020-12-30T11:06:23-08:00 Add RFC 2369 List-Owner header. - - - - - d1185327 by Mark Sapiro at 2020-12-30T19:30:40+00:00 Merge branch 'owner' into 'master' Add RFC 2369 List-Owner header. Closes #809 See merge request mailman/mailman!753 - - - - - 5 changed files: - src/mailman/app/docs/pipelines.rst - src/mailman/docs/NEWS.rst - src/mailman/handlers/docs/rfc-2369.rst - src/mailman/handlers/rfc_2369.py - src/mailman/handlers/tests/test_rfc_2369.py Changes: ===================================== src/mailman/app/docs/pipelines.rst ===================================== @@ -55,6 +55,7 @@ come later during delivery). Archived-At: <http://example.com/.../4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB> List-Archive: <http://example.com/archives/t...@example.com> List-Help: <mailto:test-requ...@example.com?subject=help> + List-Owner: <mailto:test-ow...@example.com> List-Post: <mailto:t...@example.com> List-Subscribe: <mailto:test-j...@example.com> List-Unsubscribe: <mailto:test-le...@example.com> ===================================== src/mailman/docs/NEWS.rst ===================================== @@ -32,6 +32,8 @@ Bugs (Closes #802) * The ``mailman addmembers`` command now catches and reports a ``SubscriptionPendingError``. (Closes #805) +* RFC 2369 ``List-Owner`` header is now added when these headers are included. + (Closes #809) New Features ------------ ===================================== src/mailman/handlers/docs/rfc-2369.rst ===================================== @@ -75,6 +75,7 @@ have a reduced set of `List-` headers. Specifically, there is no `List-Post`, ---start--- list-help: <mailto:test-requ...@example.com?subject=help> list-id: <test.example.com> + list-owner: <mailto:test-ow...@example.com> list-subscribe: <mailto:test-j...@example.com> list-unsubscribe: <mailto:test-le...@example.com> ---end--- @@ -97,6 +98,7 @@ header which contains the `mailto:` URL used to send messages to the list. ---start--- list-help: <mailto:test-requ...@example.com?subject=help> list-id: <test.example.com> + list-owner: <mailto:test-ow...@example.com> list-post: <mailto:t...@example.com> list-subscribe: <mailto:test-j...@example.com> list-unsubscribe: <mailto:test-le...@example.com> @@ -117,6 +119,7 @@ to RFC 2369. ---start--- list-help: <mailto:test-requ...@example.com?subject=help> list-id: <test.example.com> + list-owner: <mailto:test-ow...@example.com> list-post: NO list-subscribe: <mailto:test-j...@example.com> list-unsubscribe: <mailto:test-le...@example.com> @@ -140,6 +143,7 @@ header. ---start--- list-help: <mailto:test-requ...@example.com?subject=help> list-id: My test mailing list <test.example.com> + list-owner: <mailto:test-ow...@example.com> list-post: <mailto:t...@example.com> list-subscribe: <mailto:test-j...@example.com> list-unsubscribe: <mailto:test-le...@example.com> ===================================== src/mailman/handlers/rfc_2369.py ===================================== @@ -64,6 +64,7 @@ def process(mlist, msg, msgdata): # suppressed). headers.extend(( ('List-Help', '<mailto:{}?subject=help>'.format(requestaddr)), + ('List-Owner', '<mailto:{}>'.format(mlist.owner_address)), ('List-Unsubscribe', '<mailto:{}>'.format(mlist.leave_address)), ('List-Subscribe', '<mailto:{}>'.format(mlist.join_address)), )) ===================================== src/mailman/handlers/tests/test_rfc_2369.py ===================================== @@ -154,3 +154,29 @@ Dummy text self.assertIsNone(self._msg.get('archived-at')) self.assertIn('Exception in "broken" archiver', log_messages) self.assertIn('RuntimeError: Cannot get permalink', log_messages) + + def test_add_other_headers(self): + # Test that other RFC-2369 headers are added. + self._mlist.include_rfc2369_headers = True + rfc_2369.process(self._mlist, self._msg, {}) + self.assertEqual( + self._msg.get_all('List-Help'), + ['<mailto:{}?subject=help>'.format(self._mlist.request_address)]) + self.assertEqual( + self._msg.get_all('List-Owner'), + ['<mailto:{}>'.format(self._mlist.owner_address)]) + self.assertEqual( + self._msg.get_all('List-Unsubscribe'), + ['<mailto:{}>'.format(self._mlist.leave_address)]) + self.assertEqual( + self._msg.get_all('List-Subscribe'), + ['<mailto:{}>'.format(self._mlist.join_address)]) + + def test_dont_add_other_headers(self): + # Test that other RFC-2369 headers are not added if not requested. + self._mlist.include_rfc2369_headers = False + rfc_2369.process(self._mlist, self._msg, {}) + self.assertIsNone(self._msg.get_all('List-Help')) + self.assertIsNone(self._msg.get_all('List-Owner')) + self.assertIsNone(self._msg.get_all('List-Unsubscribe')) + self.assertIsNone(self._msg.get_all('List-Subscribe')) View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/1912d9f2cf246d45ad0683de92c5397bbf0fa158...d1185327478a787c23e4ec079eae371e13a2531c -- View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/1912d9f2cf246d45ad0683de92c5397bbf0fa158...d1185327478a787c23e4ec079eae371e13a2531c 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