From 0c97ebbf7a3f38a9f7c46ed01c1a2990caf6cfba Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 11 May 2001 20:11:17 +0000 Subject: _dispose(): Add support for mylist-join and mylist-leave aliases. The mail scripts simply add metadata `tojoin' or `toleave' respectively, which tell CommandRunner which operation to perform. This is a bit crufty since MailCommandHandler.ParseMailCommands() still handles the actual job of adding or deleting the member. CommandRunner hacks the Subject: line of the message to add just the specific desired command, and it empties the message's payload (effectively ignoring any additional commands or useless text in the email message). --- Mailman/Queue/CommandRunner.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Mailman/Queue/CommandRunner.py') diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index 13123442c..ed31fba03 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -130,6 +130,16 @@ class CommandRunner(Runner): # Just pass the message off the command handler mlist.ParseMailCommands(msg, msgdata) return + elif msgdata.get('tojoin'): + del msg['subject'] + msg['Subject'] = 'join' + msg.set_payload('') + mlist.ParseMailCommands(msg, msgdata) + elif msgdata.get('toleave'): + del msg['subject'] + msg['Subject'] = 'leave' + msg.set_payload('') + mlist.ParseMailCommands(msg, msgdata) finally: mlist.Save() mlist.Unlock() -- cgit v1.2.3-70-g09d2