diff options
| author | Barry Warsaw | 2016-07-16 15:44:07 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-07-16 15:44:07 -0400 |
| commit | dbde6231ec897379ed38ed4cd015b8ab20ed5fa1 (patch) | |
| tree | 1226d06a238314262a1d04d0bbf9c4dc0b72c309 /src/mailman/handlers/docs | |
| parent | 3387791beb7112dbe07664041f117fdcc20df53d (diff) | |
| download | mailman-dbde6231ec897379ed38ed4cd015b8ab20ed5fa1.tar.gz mailman-dbde6231ec897379ed38ed4cd015b8ab20ed5fa1.tar.zst mailman-dbde6231ec897379ed38ed4cd015b8ab20ed5fa1.zip | |
Diffstat (limited to 'src/mailman/handlers/docs')
| -rw-r--r-- | src/mailman/handlers/docs/acknowledge.rst | 8 | ||||
| -rw-r--r-- | src/mailman/handlers/docs/decorate.rst | 26 | ||||
| -rw-r--r-- | src/mailman/handlers/docs/rfc-2369.rst | 24 |
3 files changed, 24 insertions, 34 deletions
diff --git a/src/mailman/handlers/docs/acknowledge.rst b/src/mailman/handlers/docs/acknowledge.rst index 42cab04a0..fbe46b063 100644 --- a/src/mailman/handlers/docs/acknowledge.rst +++ b/src/mailman/handlers/docs/acknowledge.rst @@ -133,10 +133,6 @@ The receipt will include the original message's subject in the response body, Something witty and insightful <BLANKLINE> was successfully received by the Test mailing list. - <BLANKLINE> - List info page: http://lists.example.com/listinfo/test@example.com - Your preferences: http://example.com/aperson@example.com - <BLANKLINE> If there is no subject, then the receipt will use a generic message. @@ -169,7 +165,3 @@ If there is no subject, then the receipt will use a generic message. (no subject) <BLANKLINE> was successfully received by the Test mailing list. - <BLANKLINE> - List info page: http://lists.example.com/listinfo/test@example.com - Your preferences: http://example.com/aperson@example.com - <BLANKLINE> diff --git a/src/mailman/handlers/docs/decorate.rst b/src/mailman/handlers/docs/decorate.rst index e6199f8e0..7e02ea9eb 100644 --- a/src/mailman/handlers/docs/decorate.rst +++ b/src/mailman/handlers/docs/decorate.rst @@ -6,7 +6,7 @@ Message decoration is the process of adding headers and footers to the original message. A handler module takes care of this based on the settings of the mailing list and the type of message being processed. - >>> mlist = create_list('_xtest@example.com') + >>> mlist = create_list('ant@example.com') >>> msg_text = """\ ... From: aperson@example.org ... @@ -41,7 +41,7 @@ Simple decorations Message decorations are specified by URI and can be specialized by the mailing list and language. Internal Mailman decorations can be referenced by using -the ``mailman://`` URL scheme. Here we create a simple English header and +the ``mailman:///`` URL scheme. Here we create a simple English header and footer for all mailing lists in our site. :: @@ -51,7 +51,7 @@ footer for all mailing lists in our site. >>> os.makedirs(site_dir) >>> config.push('templates', """ ... [paths.testing] - ... template_dir: {0} + ... template_dir: {} ... """.format(template_dir)) >>> myheader_path = os.path.join(site_dir, 'myheader.txt') @@ -61,11 +61,17 @@ footer for all mailing lists in our site. >>> with open(myfooter_path, 'w') as fp: ... print('footer', file=fp) -Setting these attributes on the mailing list causes it to use these -templates. Since these are site-global templates, we can use a shorter path. +Adding these template URIs to the template manager sets the mailing list up to +use these templates. Since these are site-global templates, we can use a +shorter path. - >>> mlist.header_uri = 'mailman:///myheader.txt' - >>> mlist.footer_uri = 'mailman:///myfooter.txt' + >>> from mailman.interfaces.template import ITemplateManager + >>> from zope.component import getUtility + >>> manager = getUtility(ITemplateManager) + >>> manager.set('list:member:regular:header', + ... mlist.list_id, 'mailman:///myheader.txt') + >>> manager.set('list:member:regular:footer', + ... mlist.list_id, 'mailman:///myfooter.txt') Text messages that have no declared content type are, by default encoded in ASCII. When the mailing list's preferred language is ``en`` (i.e. English), @@ -94,14 +100,14 @@ short descriptive name for the mailing list). ... print('$display_name footer', file=fp) >>> msg = message_from_string(msg_text) - >>> mlist.display_name = 'XTest' + >>> mlist.display_name = 'Ant' >>> process(mlist, msg, {}) >>> print(msg.as_string()) From: aperson@example.org ... - XTest header + Ant header Here is a message. - XTest footer + Ant footer You can't just pick any interpolation variable though; if you do, the variable will remain in the header or footer unchanged. diff --git a/src/mailman/handlers/docs/rfc-2369.rst b/src/mailman/handlers/docs/rfc-2369.rst index 0f3cb5c5e..e2d2d6d47 100644 --- a/src/mailman/handlers/docs/rfc-2369.rst +++ b/src/mailman/handlers/docs/rfc-2369.rst @@ -73,10 +73,8 @@ have a reduced set of `List-` headers. Specifically, there is no `List-Post`, ---start--- list-help: <mailto:test-request@example.com?subject=help> list-id: <test.example.com> - list-subscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-join@example.com> - list-unsubscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-leave@example.com> + list-subscribe: <mailto:test-join@example.com> + list-unsubscribe: <mailto:test-leave@example.com> ---end--- @@ -98,10 +96,8 @@ header which contains the `mailto:` URL used to send messages to the list. list-help: <mailto:test-request@example.com?subject=help> list-id: <test.example.com> list-post: <mailto:test@example.com> - list-subscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-join@example.com> - list-unsubscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-leave@example.com> + list-subscribe: <mailto:test-join@example.com> + list-unsubscribe: <mailto:test-leave@example.com> ---end--- Some mailing lists are announce, or one-way lists, not discussion lists. @@ -120,10 +116,8 @@ to RFC 2369. list-help: <mailto:test-request@example.com?subject=help> list-id: <test.example.com> list-post: NO - list-subscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-join@example.com> - list-unsubscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-leave@example.com> + list-subscribe: <mailto:test-join@example.com> + list-unsubscribe: <mailto:test-leave@example.com> ---end--- @@ -145,10 +139,8 @@ header. list-help: <mailto:test-request@example.com?subject=help> list-id: My test mailing list <test.example.com> list-post: <mailto:test@example.com> - list-subscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-join@example.com> - list-unsubscribe: <http://lists.example.com/listinfo/test@example.com>, - <mailto:test-leave@example.com> + list-subscribe: <mailto:test-join@example.com> + list-unsubscribe: <mailto:test-leave@example.com> ---end--- Any existing ``List-Id`` headers are removed from the original message. |
