diff options
| author | Barry Warsaw | 2012-04-27 22:32:22 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-04-27 22:32:22 -0400 |
| commit | fe405ddae97cc792a343e3665b9ea645b9cf4539 (patch) | |
| tree | 8ccf5a294fdc74daad1fd754e4bef8d770965d82 | |
| parent | 658fad42b04420962e6ac478247411ee77483d93 (diff) | |
| download | mailman-fe405ddae97cc792a343e3665b9ea645b9cf4539.tar.gz mailman-fe405ddae97cc792a343e3665b9ea645b9cf4539.tar.zst mailman-fe405ddae97cc792a343e3665b9ea645b9cf4539.zip | |
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 1 | ||||
| -rw-r--r-- | src/mailman/handlers/docs/rfc-2369.rst | 27 | ||||
| -rw-r--r-- | src/mailman/handlers/rfc_2369.py | 10 |
3 files changed, 34 insertions, 4 deletions
diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 301703d52..9095f48c3 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -60,6 +60,7 @@ Bug fixes given by Mark Sapiro. (LP: #949924) * Fixed a typo when returning the configuration file's header match checks. (LP: #953497) + * List-Post should be NO when posting is not allowed. (LP: #987563) 3.0 beta 1 -- "The Twilight Zone" diff --git a/src/mailman/handlers/docs/rfc-2369.rst b/src/mailman/handlers/docs/rfc-2369.rst index 0461f27ba..875603f88 100644 --- a/src/mailman/handlers/docs/rfc-2369.rst +++ b/src/mailman/handlers/docs/rfc-2369.rst @@ -59,13 +59,14 @@ about hiding them. A list owner can turn these headers off. Messages which Mailman generates itself, such as user or owner notifications, have a reduced set of `List-` headers. Specifically, there is no `List-Post`, `List-Archive` or `Archived-At` header. +.. >>> mlist.include_rfc2369_headers = True - >>> mlist.include_list_post_header = False >>> msg = message_from_string("""\ ... From: aperson@example.com ... ... """) + >>> process(mlist, msg, dict(reduced_list_headers=True)) >>> list_headers(msg) ---start--- @@ -84,6 +85,7 @@ List-Post header Discussion lists, to which any subscriber can post, also have a `List-Post` header which contains the `mailto:` URL used to send messages to the list. + >>> mlist.include_rfc2369_headers = True >>> mlist.include_list_post_header = True >>> msg = message_from_string("""\ ... From: aperson@example.com @@ -101,6 +103,28 @@ header which contains the `mailto:` URL used to send messages to the list. <mailto:test-leave@example.com> ---end--- +Some mailing lists are announce, or one-way lists, not discussion lists. +Because the general membership cannot post to these mailing lists, the list +owner can set a flag which adds a special `List-Post` header value, according +to RFC 2369. + + >>> mlist.include_list_post_header = False + >>> msg = message_from_string("""\ + ... From: aperson@example.com + ... + ... """) + >>> process(mlist, msg, {}) + >>> list_headers(msg) + ---start--- + 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> + ---end--- + List-Id header ============== @@ -108,6 +132,7 @@ List-Id header If the mailing list has a description, then it is included in the ``List-Id`` header. + >>> mlist.include_list_post_header = True >>> mlist.description = 'My test mailing list' >>> msg = message_from_string("""\ ... From: aperson@example.com diff --git a/src/mailman/handlers/rfc_2369.py b/src/mailman/handlers/rfc_2369.py index a6e53413a..ea7b9e8dc 100644 --- a/src/mailman/handlers/rfc_2369.py +++ b/src/mailman/handlers/rfc_2369.py @@ -74,9 +74,13 @@ def process(mlist, msg, msgdata): 'List-Subscribe' : subfieldfmt.format(listinfo, mlist.join_address), }) if not msgdata.get('reduced_list_headers'): - # List-Post: is controlled by a separate attribute - if mlist.include_list_post_header: - headers['List-Post'] = '<mailto:{0}>'.format(mlist.posting_address) + # List-Post: is controlled by a separate attribute, which is somewhat + # misnamed. RFC 2369 requires a value of NO if posting is not + # allowed, i.e. for an announce-only list. + list_post = ('<mailto:{0}>'.format(mlist.posting_address) + if mlist.include_list_post_header + else 'NO') + headers['List-Post'] = list_post # Add RFC 2369 and 5064 archiving headers, if archiving is enabled. if mlist.archive: for archiver in config.archivers: |
