[Mailman-Users] Limit list subscribers by domain

Mark Sapiro mark at msapiro.net
Fri Aug 29 21:51:48 CEST 2008

Barry Finkel wrote:

>"David Slater" <dslater at ocln.org> wrote:
>>Hello -
>>I want to deny list subscriptions to any user whose email
>>address does not include my domain.
>>I realize that I can do that by having the list admin approve
>>subscription requests, but I'd prefer to automate the process.
>>I would hope that a rejection notice would be sent to any person
>>who subscribes and does not have the correct email domain.
>>Does anyone know how to do this - or is this something
>>that I should submit as a feature / enhancement request?
>Use ban_list
>     ^!*.example.com
>to prevent all subscriptions that are not from example.com .  This
>regex will allow subscriptions from
>     @aaa.example.com

That's the right idea except that is not a Python regular expression
<http://www.python.org/doc/current/lib/re-syntax.html>. Well,
actually, it is valid, but it doesn't do what you want. It matches
anything that starts with 0 or more '!' followed by any character
followed by 'example' followed by any character followed by 'com' with
possible trailing stuff after that.

What you would need to ban addresses not in the example.com domain or a
sub-domain thereof is something like


Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list