1 Mar 2008 02:01
Re: Regular expressions in list config files?
Mark Sapiro <mark <at> msapiro.net>
2008-03-01 01:01:17 GMT
2008-03-01 01:01:17 GMT
bernholdtde <at> ornl.gov wrote: > >Here's the result: In applying header_filter_rules, it looks like the >entire set of headers is being treated as a single multiline string. That is correct. >For reasons I don't entirely understand (remember I'm not a python >expert), "^" and "$" are not matching the beginning and end of >individual lines of a multiline string, even though I interpreted >http://www.python.org/doc/current/lib/matching-searching.html to say >that they should, and a colleague who's very familiar with Python also >thought they should. It works for me. I just set a header_filter_rules regexp on a test list to "^subject:.*hello.*$" with a reject action, and my test post with Subject: test Hello in subject was rejected with "Message rejected by filter rule match". In case you're wondering, the Subject: was the 15th of 21 headers in the message delivered to Mailman. I then tested the regexp "^subject:\s+yes\s*$" with a post with Subject: yes and it too was caught. >If I don't have the line beginning/ending constraints in the regex,(Continue reading)
RSS Feed