diff options
Diffstat (limited to 'src/mailman/queue/docs')
| -rw-r--r-- | src/mailman/queue/docs/command.txt | 99 | ||||
| -rw-r--r-- | src/mailman/queue/docs/lmtp.txt | 206 |
2 files changed, 305 insertions, 0 deletions
diff --git a/src/mailman/queue/docs/command.txt b/src/mailman/queue/docs/command.txt index 88e4387d4..fd0236a8c 100644 --- a/src/mailman/queue/docs/command.txt +++ b/src/mailman/queue/docs/command.txt @@ -108,6 +108,105 @@ message is plain text. <BLANKLINE> +Implicit commands +================= + +For some commands, specifically for joining and leaving a mailing list, there +are email aliases that act like commands, even when there's nothing else in +the Subject or body. For example, to join a mailing list, a user need only +email the -join address or -subscribe address (the latter is deprecated). + +Because Dirk has never registered with Mailman before, he gets two responses. +The first is a confirmation message so that Dirk can validate his email +address, and the other is the results of his email command. + + >>> msg = message_from_string("""\ + ... From: Dirk Person <dperson@example.com> + ... To: test-join@example.com + ... + ... """) + + >>> inject_message(mlist, msg, switchboard='command', subaddress='join') + >>> command.run() + >>> len(virgin_queue.files) + 2 + + >>> def sortkey(item): + ... return item.msg['subject'] + >>> messages = sorted(get_queue_messages('virgin'), key=sortkey) + >>> for item in messages: + ... print 'Subject:', item.msg['subject'] + Subject: confirm ... + Subject: The results of your email commands + +Similarly, to leave a mailing list, the user need only email the -leave or +-unsubscribe address (the latter is deprecated). + + >>> msg = message_from_string("""\ + ... From: dperson@example.com + ... To: test-leave@example.com + ... + ... """) + + >>> inject_message(mlist, msg, switchboard='command', subaddress='leave') + >>> command.run() + >>> len(virgin_queue.files) + 1 + >>> item = get_queue_messages('virgin')[0] + >>> print item.msg.as_string() + Subject: The results of your email commands + From: test-bounces@example.com + To: dperson@example.com + ... + <BLANKLINE> + The results of your email command are provided below. + <BLANKLINE> + - Original message details: + From: dperson@example.com + Subject: n/a + Date: ... + Message-ID: ... + <BLANKLINE> + - Results: + dperson@example.com left test@example.com + <BLANKLINE> + - Done. + <BLANKLINE> + +The -confirm address is also available as an implicit command. + + >>> msg = message_from_string("""\ + ... From: dperson@example.com + ... To: test-confirm+123@example.com + ... + ... """) + + >>> inject_message(mlist, msg, switchboard='command', subaddress='confirm') + >>> command.run() + >>> len(virgin_queue.files) + 1 + >>> item = get_queue_messages('virgin')[0] + >>> print item.msg.as_string() + Subject: The results of your email commands + From: test-bounces@example.com + To: dperson@example.com + ... + <BLANKLINE> + The results of your email command are provided below. + <BLANKLINE> + - Original message details: + From: dperson@example.com + Subject: n/a + Date: ... + Message-ID: ... + <BLANKLINE> + - Results: + Confirmed + <BLANKLINE> + - Done. + <BLANKLINE> + + Stopping command processing =========================== diff --git a/src/mailman/queue/docs/lmtp.txt b/src/mailman/queue/docs/lmtp.txt index 5961bea50..549161b08 100644 --- a/src/mailman/queue/docs/lmtp.txt +++ b/src/mailman/queue/docs/lmtp.txt @@ -61,6 +61,25 @@ Once the mailing list is created, the posting address is valid. ... """) {} + >>> from mailman.testing.helpers import get_queue_messages + >>> messages = get_queue_messages('in') + >>> len(messages) + 1 + >>> print messages[0].msg.as_string() + From: anne.person@example.com + To: mylist@example.com + Subject: An interesting message + Message-ID: <badger> + X-MailFrom: anne.person@example.com + <BLANKLINE> + This is an interesting message. + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + to_list : True + version : ... + Sub-addresses ============= @@ -98,6 +117,193 @@ But the message is accepted if posted to a valid sub-address. {} +Request subaddress +------------------ + +Depending on the subaddress, there is a message in the appropriate queue for +later processing. For example, all -request messages are put into the command +queue for processing. + + >>> messages = get_queue_messages('command') + >>> len(messages) + 1 + >>> print messages[0].msg.as_string() + From: anne.person@example.com + To: mylist-request@example.com + Subject: Help + Message-ID: <dog> + X-MailFrom: anne.person@example.com + <BLANKLINE> + Please help me. + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : request + version : ... + + +Bounce processor +---------------- + +A message to the -bounces address goes to the bounce processor. + + >>> lmtp.sendmail( + ... 'mail-daemon@example.com', + ... ['mylist-bounces@example.com'], """\ + ... From: mail-daemon@example.com + ... To: mylist-bounces@example.com + ... Subject: A bounce + ... Message-ID: <elephant> + ... + ... Bouncy bouncy. + ... """) + {} + >>> messages = get_queue_messages('bounces') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : bounces + version : ... + + +Command processor +----------------- + +Confirmation messages go to the command processor... + + >>> lmtp.sendmail( + ... 'anne.person@example.com', + ... ['mylist-confirm@example.com'], """\ + ... From: anne.person@example.com + ... To: mylist-confirm@example.com + ... Subject: A bounce + ... Message-ID: <falcon> + ... + ... confirm 123 + ... """) + {} + >>> messages = get_queue_messages('command') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : confirm + version : ... + +...as do join messages... + + >>> lmtp.sendmail( + ... 'anne.person@example.com', + ... ['mylist-join@example.com'], """\ + ... From: anne.person@example.com + ... To: mylist-join@example.com + ... Message-ID: <giraffe> + ... + ... """) + {} + >>> messages = get_queue_messages('command') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : join + version : ... + + >>> lmtp.sendmail( + ... 'anne.person@example.com', + ... ['mylist-subscribe@example.com'], """\ + ... From: anne.person@example.com + ... To: mylist-subscribe@example.com + ... Message-ID: <hippopotamus> + ... + ... """) + {} + >>> messages = get_queue_messages('command') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : join + version : ... + +...and leave messages. + + >>> lmtp.sendmail( + ... 'anne.person@example.com', + ... ['mylist-leave@example.com'], """\ + ... From: anne.person@example.com + ... To: mylist-leave@example.com + ... Message-ID: <iguana> + ... + ... """) + {} + >>> messages = get_queue_messages('command') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : leave + version : ... + + >>> lmtp.sendmail( + ... 'anne.person@example.com', + ... ['mylist-unsubscribe@example.com'], """\ + ... From: anne.person@example.com + ... To: mylist-unsubscribe@example.com + ... Message-ID: <jackal> + ... + ... """) + {} + >>> messages = get_queue_messages('command') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + listname : mylist@example.com + original_size: ... + subaddress : leave + version : ... + + +Incoming processor +------------------ + +Messages to the -owner address go to the incoming processor. + + >>> lmtp.sendmail( + ... 'anne.person@example.com', + ... ['mylist-owner@example.com'], """\ + ... From: anne.person@example.com + ... To: mylist-owner@example.com + ... Message-ID: <kangaroo> + ... + ... """) + {} + >>> messages = get_queue_messages('in') + >>> len(messages) + 1 + >>> dump_msgdata(messages[0].msgdata) + _parsemsg : False + envsender : changeme@example.com + listname : mylist@example.com + original_size: ... + subaddress : owner + to_owner : True + version : ... + + Clean up ======== |
