[Mailman-Developers] Why no regex for forbidden_posters[] ?
Nathan V. Patwardhan
nvp@atg.com
Thu, 30 Aug 2001 14:44:08 -0400
All,
I'd hoped that Mailman would let me have "closed" lists in the sense
that I could reject anything from outside of 'atg.com'.
forbidden_posters[], I figured, was implemented to take a regular
expression. Instead, it seems that Utils.py implements
FindMatchingAddresses(...), which returns an *exact match* of an
address. This isn't the behavior that I'd hoped for, since (a) we're
sure to have open lists that are only used internally and (b)
So, I guess that I have two questions:
1. What would be wrong with having something like this:
# in a list's config
forbidden_posters = ['^.*@(?!atg.com$)', 'another_regex_here', 'etc...']
# from Handlers/Hold.py
addrs = Utils.FindMatchingAddresses(sender, forbiddens)
if addrs:
hold_for_approval(mlist, msg, msgdata, ForbiddenPoster)
...
def FindMatchingAddresses(sender, forbiddens):
res = []
for each_banned in forbiddens:
p = re.compile(each_banned)
m = p.match(each_banned)
if m != None:
res.append(each_banned)
return res
2. Instead of hold_for_approval(...), would anyone have any objections
if a method like kill_forbidden_message(...) was implemented? We
have many, many lists and often times a list administrator (the
users themselves) won't think to delete messages that are blocked,
yet get held for approval.
--
Nate Patwardhan
Art Technology Group
********************************************
$ ping elvis
elvis is alive