From bb6c75c2cf3ec7746bc685d18d8f19a60f7f36e8 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Wed, 8 Sep 1999 23:09:40 +0000 Subject: ParseMailCommands(): Quickie patch to allow quotes around the command part of the email command. This means "help" [sic] works and you don't have to say: Send the word "help" (sans quotes) to ... --- Mailman/MailCommandHandler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Mailman/MailCommandHandler.py b/Mailman/MailCommandHandler.py index cc9bc410a..8280dff4a 100644 --- a/Mailman/MailCommandHandler.py +++ b/Mailman/MailCommandHandler.py @@ -74,6 +74,8 @@ option_info = {'digest' : 0, # ordered list options = ('hide', 'nomail', 'ack', 'notmetoo', 'digest', 'plain') +# strip just the outer layer of quotes +quotecre = re.compile(r'["\'`](?P.*)["\'`]') class MailCommandHandler: @@ -133,6 +135,10 @@ class MailCommandHandler: return if subject: subject = string.strip(subject) + # remove quotes so "help" works + mo = quotecre.search(subject) + if mo: + subject = mo.group('cmd') if (subject and self.__dispatch.has_key(string.lower(string.split(subject)[0]))): lines = [subject] + string.split(msg.body, '\n') @@ -165,6 +171,10 @@ class MailCommandHandler: continue args = string.split(line) cmd = string.lower(args[0]) + # remove quotes so "help" or `help' works + mo = quotecre.search(cmd) + if mo: + cmd = mo.group('cmd') args = args[1:] if cmd in ['end', '--']: self.AddToResponse('\n***** End: ' + line + '\n' -- cgit v1.3.1