diff options
| -rw-r--r-- | src/mailman/archiving/docs/common.rst | 2 | ||||
| -rw-r--r-- | src/mailman/handlers/docs/rfc-2369.rst | 4 | ||||
| -rw-r--r-- | src/mailman/handlers/tests/test_rfc_2369.py | 17 | ||||
| -rw-r--r-- | src/mailman/interfaces/archiver.py | 4 |
4 files changed, 15 insertions, 12 deletions
diff --git a/src/mailman/archiving/docs/common.rst b/src/mailman/archiving/docs/common.rst index 3fbc72d43..5666e9a39 100644 --- a/src/mailman/archiving/docs/common.rst +++ b/src/mailman/archiving/docs/common.rst @@ -21,7 +21,7 @@ header, and one that provides a *permalink* to the specific message object in the archive. This latter is appropriate for the message footer or for the RFC 5064 ``Archived-At:`` header. -If the archiver is not network-accessible, it can return ``None`` and the +If the archiver is not network-accessible, it will return ``None`` and the headers will not be added. Mailman defines a draft spec for how list servers and archivers can diff --git a/src/mailman/handlers/docs/rfc-2369.rst b/src/mailman/handlers/docs/rfc-2369.rst index 052aa7156..0f3cb5c5e 100644 --- a/src/mailman/handlers/docs/rfc-2369.rst +++ b/src/mailman/handlers/docs/rfc-2369.rst @@ -169,8 +169,8 @@ Any existing ``List-Id`` headers are removed from the original message. Archive headers =============== -When the mailing list is configured to enable archiving, a `List-Archive` -header will be added. +When the mailing list is configured to enable archiving, ``List-Archive`` +headers will be added for each web accessible archiver that is enabled. `RFC 5064`_ defines the `Archived-At` header which contains the url to the individual message in the archives. Archivers which don't support diff --git a/src/mailman/handlers/tests/test_rfc_2369.py b/src/mailman/handlers/tests/test_rfc_2369.py index b297d04c2..dc622e528 100644 --- a/src/mailman/handlers/tests/test_rfc_2369.py +++ b/src/mailman/handlers/tests/test_rfc_2369.py @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2015 by the Free Software Foundation, Inc. +# Copyright (C) 2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # @@ -23,16 +23,15 @@ __all__ = [ import unittest -from urllib.parse import urljoin - -from zope.interface import implementer from mailman.app.lifecycle import create_list from mailman.config import config -from mailman.interfaces.archiver import ArchivePolicy, IArchiver from mailman.handlers import rfc_2369 +from mailman.interfaces.archiver import ArchivePolicy, IArchiver from mailman.testing.helpers import specialized_message_from_string as mfs from mailman.testing.layers import ConfigLayer +from urllib.parse import urljoin +from zope.interface import implementer @implementer(IArchiver) @@ -107,8 +106,8 @@ Dummy text """) self.addCleanup(config.pop, 'archiver') rfc_2369.process(self._mlist, self._msg, {}) - self.assertFalse('Archived-At' in self._msg) - self.assertFalse('List-Archive' in self._msg) + self.assertNotIn('Archived-At', self._msg) + self.assertNotIn('List-Archive', self._msg) def test_not_archived(self): # Messages sent to non-archived lists must not get the added headers. @@ -120,5 +119,5 @@ Dummy text """.format(DummyArchiver.__module__)) self.addCleanup(config.pop, 'archiver') rfc_2369.process(self._mlist, self._msg, {}) - self.assertFalse('List-Archive' in self._msg) - self.assertFalse('Archived-At' in self._msg) + self.assertNotIn('List-Archive', self._msg) + self.assertNotIn('Archived-At', self._msg) diff --git a/src/mailman/interfaces/archiver.py b/src/mailman/interfaces/archiver.py index 1aa4574e7..b17e43d6e 100644 --- a/src/mailman/interfaces/archiver.py +++ b/src/mailman/interfaces/archiver.py @@ -53,6 +53,8 @@ class IArchiver(Interface): def list_url(mlist): """Return the url to the top of the list's archive. + If the archiver is not web-accessible, return None. + :param mlist: The IMailingList object. :returns: The url string. """ @@ -63,6 +65,8 @@ class IArchiver(Interface): This url points directly to the message in the archive. This method only calculates the url, it does not actually archive the message. + If the archiver is not web-accessible, return None. + :param mlist: The IMailingList object. :param msg: The message object. :returns: The url string or None if the message's archive url cannot |
