Hi Chris,

On Tuesday 06 October 2015 08:37 PM, Chris Nulk wrote:
> Hello all,
>
> I have been loosely following the discussion regarding regex in the
> ban_list attribute.  I now find myself being asked to create a list
> which will most likely use the ban_list attribute.  So, I have a few
> questions.
>
> 1. The ban_list attribute is to help prevent unwanted people from
> subscribing to a list, however, I want to restrict who can subscribe
> to the list and ban anyone else.  I have the regex for who I want to
> allow to subscribe but there isn't an allow_list attribute.  Is there
> an easy way of allowing a regex to control who is able to subscribe? 
> Or, is there a way to easily invert the regex logic and use it in
> ban_list?  As an example (not the real regex), say I want to only
> allow @gmail.com to subscribe to the list but no one else.
You can use ban_list to accomplish this. You just have to revert the
matching criteria. For example if you want to allow only example.org and
example.com you can use the following regex

^[^@]+@(?!(.*\.)?example\.(org|com)$)

Regards
Aditya Jain

------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to