From a542b45f13b6da18a63927f3324faa6b3ffefe71 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sun, 1 Mar 2015 08:35:02 -0800 Subject: Fixed a bug in CommandRunner that could process the second word of a body line as a command word and a case sensitivity in commands in Subject: with an Re: prefix. --- Mailman/Queue/CommandRunner.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Mailman/Queue') diff --git a/Mailman/Queue/CommandRunner.py b/Mailman/Queue/CommandRunner.py index 6fbcac2a..c5cc3d94 100644 --- a/Mailman/Queue/CommandRunner.py +++ b/Mailman/Queue/CommandRunner.py @@ -146,18 +146,21 @@ class Results: # # If that still didn't work it isn't enough to stop processing. # BAW: should we include a message that the Subject: was ignored? + # + # But first, be sure we're looking at the Subject: and not past + # it already. + if self.lineno != 0: + return BADCMD if self.subjcmdretried < 1: self.subjcmdretried += 1 if re.search('^.*:.+', cmd): - return self.do_command(re.sub('.*:', '', cmd), args) + cmd = re.sub('.*:', '', cmd).lower() + return self.do_command(cmd, args) if self.subjcmdretried < 2 and args: self.subjcmdretried += 1 - cmd = args.pop(0) + cmd = args.pop(0).lower() return self.do_command(cmd, args) - if self.lineno <> 0: - return BADCMD - else: - return BADSUBJ + return BADSUBJ if handler.process(self, args): return STOP else: -- cgit v1.2.3