Shunting messages when topic-keyword is defined twice

Bug #327008 reported by Peer Heinlein
2
Affects Status Importance Assigned to Milestone
GNU Mailman
Fix Released
Undecided
Mark Sapiro

Bug Description

Bug noticed in Mailman 2.1.11.

Having "topics_enabled" a double-defined keyword leads to a crash of the whole list.

Define

Wohnung*
*wohnung*

and all messages are shunted:

Feb 08 23:42:59 2009 (3455) Uncaught runner exception: multiple repeat
Feb 08 23:42:59 2009 (3455) Traceback (most recent call last):
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 120, in _oneloop
    self._onefile(msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 191, in _onefile
    keepqueued = self._dispose(mlist, msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/IncomingRunner.py", line 130, in _dispose
    more = self._dopipeline(mlist, msg, msgdata, pipeline)
  File "/usr/lib/mailman/Mailman/Queue/IncomingRunner.py", line 153, in _dopipeline
    sys.modules[modname].process(mlist, msg, msgdata)
  File "/usr/lib/mailman/Mailman/Handlers/Tagger.py", line 56, in process
    cre = re.compile(pattern, re.IGNORECASE | re.VERBOSE)
  File "/usr/lib/python2.5/re.py", line 180, in compile
    return _compile(pattern, flags)
  File "/usr/lib/python2.5/re.py", line 233, in _compile
    raise error, v # invalid expression
error: multiple repeat

Feb 08 23:42:59 2009 (3455) SHUNTING: 1234132979.41008+3c028a6ab5bb6634f9813d5e4686e040304ba4dd

Related branches

Revision history for this message
Mark Sapiro (msapiro) wrote :

This is fixed in Mailman 2.2. I'll fix it as well in for 2.1.12, but there are several caveats.

The main problem is the regexps entry for topics is not properly documented. In your case, the issue is not that you have the same word defined twice; it is that your regexp is invalid. For example, I think you really want something like

Wohnung.*|
.*wohnung.*

'*' is not a wildcard in regular expressions as it is for example in file name globing. You probably want '.*'. Also, the implication is if you list separate keywords on separate lines that they are connected with 'or', but the regexp is ultimately compiles in 'verbose' mode, so the lines are just strung together. This is where the documentation is wrong. This is all clarified and fixed in Mailman 2.2.

The problem in 2.1 is when you enter the regexp, we validate in by attempting to compile it normally, so we check 'Wohnung*\r\n*wohnung*' which doesn't mean what you want, but is valid, but when we use it we compile effectively 'Wohnung**wohnung*' which is not valid and throws the exception.

Note that the regexp is matched case insensitively in any case.

Changed in mailman:
assignee: nobody → msapiro
status: New → In Progress
Mark Sapiro (msapiro)
Changed in mailman:
status: In Progress → Fix Committed
Mark Sapiro (msapiro)
Changed in mailman:
milestone: none → 2.1.12
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.