[Mailman-Developers] Regexp filtering
Stephen J. Turnbull
stephen at xemacs.org
Sat Feb 27 00:02:49 EST 2016
On Mailman-Users, Mark Sapiro writes:
> Further, in the ban_list (and many other places in Mailman) if an
> address is intended to be a regular expression pattern, it must begin
> with '^', so you really want
>
> ^.*@domain\.com$
>
> to match any_address at domain.com.
I hope we haven't propagated this rather user-unfriendly interface
(the convention of accepting both regexps and literals, distinguishing
by "^" in column 0) to Mailman 3. Even as a Python programmer, I find
Mark's post somewhat confusing: I would design filters using
re.search, so that the above would actually be equivalent as a Python
regular expression to r"@domain\.com$". OTOH, if the implementation
uses re.match, the "^" is redundant, so I have a "say what?!" event.
If we have, I propose changing it to
Ban these addresses, one entry per line: [ ]
[ ] Entries are regular expressions.
or something like that. We also ought to have a "Python features for
Mailman administrators" section of the FAQ, starting with "what is a
regular expression", and giving examples of how to accomplish common
tasks like banning a whole domain with regular expressions. Typical
regexp FAQs are hard for non-programmers (and even beginning
programmers) to grasp.
I don't have time to actually work on these now, but if there's uptake
on the suggestion ("let's think about it" at +0 or above :-) I'll file
issues.
More information about the Mailman-Developers
mailing list