summaryrefslogtreecommitdiff
path: root/src/mailman/runners/docs
diff options
context:
space:
mode:
authorBarry Warsaw2012-03-04 02:53:44 -0500
committerBarry Warsaw2012-03-04 02:53:44 -0500
commit6c8cbfc327e05b11f22e675941f320731f3c79ce (patch)
treea594634a0f824b84e2e6645db913dcb0f6fee0ac /src/mailman/runners/docs
parentfe855654a1c67fad869c3035548b6f1b51350258 (diff)
downloadmailman-6c8cbfc327e05b11f22e675941f320731f3c79ce.tar.gz
mailman-6c8cbfc327e05b11f22e675941f320731f3c79ce.tar.zst
mailman-6c8cbfc327e05b11f22e675941f320731f3c79ce.zip
* A welcome message is sent when the user confirms their subscription via
email. Also: - The user's Full Name is included on the To line of a welcome message. - Clean up some tests. - The welcome_message_uri for lists using the default style is set to mailman:///welcome.txt so a welcome message is sent by default.
Diffstat (limited to 'src/mailman/runners/docs')
-rw-r--r--src/mailman/runners/docs/command.rst61
1 files changed, 34 insertions, 27 deletions
diff --git a/src/mailman/runners/docs/command.rst b/src/mailman/runners/docs/command.rst
index f2fa86fcf..43682056b 100644
--- a/src/mailman/runners/docs/command.rst
+++ b/src/mailman/runners/docs/command.rst
@@ -8,6 +8,7 @@ number of email commands out of the box. These are processed when a message
is sent to the list's ``-request`` address.
>>> mlist = create_list('test@example.com')
+ >>> mlist.send_welcome_messages = False
A command in the Subject
@@ -33,14 +34,14 @@ the sender. The command can be in the ``Subject`` header.
>>> command.run()
And now the response is in the ``virgin`` queue.
+::
- >>> from mailman.core.switchboard import Switchboard
- >>> virgin_queue = config.switchboards['virgin']
- >>> len(virgin_queue.files)
- 1
>>> from mailman.testing.helpers import get_queue_messages
- >>> item = get_queue_messages('virgin')[0]
- >>> print item.msg.as_string()
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
+ 1
+
+ >>> print messages[0].msg.as_string()
Subject: The results of your email commands
From: test-bounces@example.com
To: aperson@example.com
@@ -59,7 +60,8 @@ And now the response is in the ``virgin`` queue.
<BLANKLINE>
- Done.
<BLANKLINE>
- >>> dump_msgdata(item.msgdata)
+
+ >>> dump_msgdata(messages[0].msgdata)
_parsemsg : False
listname : test@example.com
nodecorate : True
@@ -85,10 +87,11 @@ message is plain text.
>>> inject_message(mlist, msg, switchboard='command')
>>> command.run()
- >>> len(virgin_queue.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> item = get_queue_messages('virgin')[0]
- >>> print item.msg.as_string()
+
+ >>> print messages[0].msg.as_string()
Subject: The results of your email commands
From: test-bounces@example.com
To: bperson@example.com
@@ -132,13 +135,10 @@ address, and the other is the results of his email command.
>>> inject_message(mlist, msg, switchboard='command', subaddress='join')
>>> command.run()
- >>> len(virgin_queue.files)
+ >>> messages = get_queue_messages('virgin', sort_on='subject')
+ >>> len(messages)
2
- >>> def sortkey(item):
- ... return str(item.msg['subject'])
- >>> messages = sorted(get_queue_messages('virgin'), key=sortkey)
-
>>> from mailman.interfaces.registrar import IRegistrar
>>> from zope.component import getUtility
>>> registrar = getUtility(IRegistrar)
@@ -152,6 +152,9 @@ address, and the other is the results of his email command.
Subject: The results of your email commands
Subject: confirm ...
+.. Clear the queue
+ >>> ignore = get_queue_messages('virgin')
+
Similarly, to leave a mailing list, the user need only email the ``-leave`` or
``-unsubscribe`` address (the latter is deprecated).
::
@@ -164,10 +167,11 @@ Similarly, to leave a mailing list, the user need only email the ``-leave`` or
>>> inject_message(mlist, msg, switchboard='command', subaddress='leave')
>>> command.run()
- >>> len(virgin_queue.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> item = get_queue_messages('virgin')[0]
- >>> print item.msg.as_string()
+
+ >>> print messages[0].msg.as_string()
Subject: The results of your email commands
From: test-bounces@example.com
To: dperson@example.com
@@ -198,10 +202,11 @@ The ``-confirm`` address is also available as an implicit command.
>>> inject_message(mlist, msg, switchboard='command', subaddress='confirm')
>>> command.run()
- >>> len(virgin_queue.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> item = get_queue_messages('virgin')[0]
- >>> print item.msg.as_string()
+
+ >>> print messages[0].msg.as_string()
Subject: The results of your email commands
From: test-bounces@example.com
To: dperson@example.com
@@ -241,10 +246,11 @@ looked at by the command queue.
>>> inject_message(mlist, msg, switchboard='command')
>>> command.run()
- >>> len(virgin_queue.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> item = get_queue_messages('virgin')[0]
- >>> print item.msg.as_string()
+
+ >>> print messages[0].msg.as_string()
Subject: The results of your email commands
...
<BLANKLINE>
@@ -272,10 +278,11 @@ The ``stop`` command is an alias for ``end``.
>>> inject_message(mlist, msg, switchboard='command')
>>> command.run()
- >>> len(virgin_queue.files)
+ >>> messages = get_queue_messages('virgin')
+ >>> len(messages)
1
- >>> item = get_queue_messages('virgin')[0]
- >>> print item.msg.as_string()
+
+ >>> print messages[0].msg.as_string()
Subject: The results of your email commands
...
<BLANKLINE>