Re: [Mailman-Users] Limit list subscribers by domain
![](https://secure.gravatar.com/avatar/457538a2d31f6f54724e0a6ffd687e86.jpg?s=120&d=mm&r=g)
"David Slater" <dslater@ocln.org> wrote:
Use ban_list
^!*.example.com
to prevent all subscriptions that are not from example.com . This regex will allow subscriptions from
@aaa.example.com
Barry S. Finkel Computing and Information Systems Division Argonne National Laboratory Phone: +1 (630) 252-7277 9700 South Cass Avenue Facsimile:+1 (630) 252-4601 Building 222, Room D209 Internet: BSFinkel@anl.gov Argonne, IL 60439-4828 IBMMAIL: I1004994
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
Barry Finkel wrote:
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
^.*@(?!(.*\.)?example\.com$)
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/56f108518d7ee2544412cc80978e3182.jpg?s=120&d=mm&r=g)
Barry Finkel wrote:
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
^.*@(?!(.*\.)?example\.com$)
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
b19141@anl.gov
-
Mark Sapiro