diff options
| author | Barry Warsaw | 2012-03-14 20:50:31 -0700 |
|---|---|---|
| committer | Barry Warsaw | 2012-03-14 20:50:31 -0700 |
| commit | ab2158babc1b2f26e3c9c37b128cb949e726427d (patch) | |
| tree | 489e14fed318c6007615e9b6c801c9e5782d6792 /src/mailman/app/docs | |
| parent | 7492328240dad73b300d49cca40030395b090808 (diff) | |
| parent | 048d8b66972af87170803fd67f02f8c720694bbc (diff) | |
| download | mailman-ab2158babc1b2f26e3c9c37b128cb949e726427d.tar.gz mailman-ab2158babc1b2f26e3c9c37b128cb949e726427d.tar.zst mailman-ab2158babc1b2f26e3c9c37b128cb949e726427d.zip | |
* Subscription disabled probe warning notification messages are now sent
without a `Precedence:` header. Given by Mark Sapiro. (LP: #808821)
Diffstat (limited to 'src/mailman/app/docs')
| -rw-r--r-- | src/mailman/app/docs/bounces.rst | 12 | ||||
| -rw-r--r-- | src/mailman/app/docs/message.rst | 61 |
2 files changed, 57 insertions, 16 deletions
diff --git a/src/mailman/app/docs/bounces.rst b/src/mailman/app/docs/bounces.rst index f825064e3..5510f2207 100644 --- a/src/mailman/app/docs/bounces.rst +++ b/src/mailman/app/docs/bounces.rst @@ -12,12 +12,12 @@ Mailman can bounce messages back to the original sender. This is essentially equivalent to rejecting the message with notification. Mailing lists can bounce a message with an optional error message. - >>> mlist = create_list('_xtest@example.com') + >>> mlist = create_list('text@example.com') Any message can be bounced. >>> msg = message_from_string("""\ - ... To: _xtest@example.com + ... To: text@example.com ... From: aperson@example.com ... Subject: Something important ... @@ -36,7 +36,7 @@ to the original message author. 1 >>> print items[0].msg.as_string() Subject: Something important - From: _xtest-owner@example.com + From: text-owner@example.com To: aperson@example.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="..." @@ -54,7 +54,7 @@ to the original message author. Content-Type: message/rfc822 MIME-Version: 1.0 <BLANKLINE> - To: _xtest@example.com + To: text@example.com From: aperson@example.com Subject: Something important <BLANKLINE> @@ -74,7 +74,7 @@ passed in as an instance of a ``RejectMessage`` exception. 1 >>> print items[0].msg.as_string() Subject: Something important - From: _xtest-owner@example.com + From: text-owner@example.com To: aperson@example.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="..." @@ -92,7 +92,7 @@ passed in as an instance of a ``RejectMessage`` exception. Content-Type: message/rfc822 MIME-Version: 1.0 <BLANKLINE> - To: _xtest@example.com + To: text@example.com From: aperson@example.com Subject: Something important <BLANKLINE> diff --git a/src/mailman/app/docs/message.rst b/src/mailman/app/docs/message.rst index 3e3293196..3c3fd8ea8 100644 --- a/src/mailman/app/docs/message.rst +++ b/src/mailman/app/docs/message.rst @@ -2,7 +2,7 @@ Messages ======== -Mailman has its own Message classes, derived from the standard +Mailman has its own `Message` classes, derived from the standard ``email.message.Message`` class, but providing additional useful methods. @@ -13,7 +13,7 @@ When Mailman needs to send a message to a user, it creates a ``UserNotification`` instance, and then calls the ``.send()`` method on this object. This method requires a mailing list instance. - >>> mlist = create_list('_xtest@example.com') + >>> mlist = create_list('test@example.com') The ``UserNotification`` constructor takes the recipient address, the sender address, an optional subject, optional body text, and optional language. @@ -21,28 +21,69 @@ address, an optional subject, optional body text, and optional language. >>> from mailman.email.message import UserNotification >>> msg = UserNotification( ... 'aperson@example.com', - ... '_xtest@example.com', + ... 'test@example.com', ... 'Something you need to know', ... 'I needed to tell you this.') >>> msg.send(mlist) The message will end up in the `virgin` queue. - >>> switchboard = config.switchboards['virgin'] - >>> len(switchboard.files) + >>> from mailman.testing.helpers import get_queue_messages + >>> messages = get_queue_messages('virgin') + >>> len(messages) 1 - >>> filebase = switchboard.files[0] - >>> qmsg, qmsgdata = switchboard.dequeue(filebase) - >>> switchboard.finish(filebase) - >>> print qmsg.as_string() + >>> print messages[0].msg.as_string() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: Something you need to know - From: _xtest@example.com + From: test@example.com To: aperson@example.com Message-ID: ... Date: ... Precedence: bulk <BLANKLINE> I needed to tell you this. + +The message above got a `Precedence: bulk` header added by default. If the +message we're sending already has a `Precedence:` header, it shouldn't be +changed. + + >>> del msg['precedence'] + >>> msg['Precedence'] = 'list' + >>> msg.send(mlist) + +Again, the message will end up in the `virgin` queue but with the original +`Precedence:` header. + + >>> messages = get_queue_messages('virgin') + >>> len(messages) + 1 + >>> print messages[0].msg['precedence'] + list + +Sometimes we want to send the message without a `Precedence:` header such as +when we send a probe message. + + >>> del msg['precedence'] + >>> msg.send(mlist, add_precedence=False) + +Again, the message will end up in the `virgin` queue but without the +`Precedence:` header. + + >>> messages = get_queue_messages('virgin') + >>> len(messages) + 1 + >>> print messages[0].msg['precedence'] + None + +However, if the message already has a `Precedence:` header, setting the +`precedence=False` argument will have no effect. + + >>> msg['Precedence'] = 'junk' + >>> msg.send(mlist, add_precedence=False) + >>> messages = get_queue_messages('virgin') + >>> len(messages) + 1 + >>> print messages[0].msg['precedence'] + junk |
