On 02/26/2016 09:03 AM, Stephen J. Turnbull wrote:
> Hone, Don writes:
> 
>  > I'm able to ban a specific email address by using the withlist command:
>  > 
>  > ~mailman/bin/withlist -a -r add_banned -- addr...@domain.com
>  > 
>  > Is there a command that I can use to reverse this?
> 
> I'll have to pass that to Mark, it's his script.


You could modify the script. I.e., make a new script remove_banned.py
which is a copy of add_banned.py with every occurrence of 'add_banned'
replaced by 'remove_banned' and the line

    mlist.ban_list.append(address)

replaced by

    mlist.ban_list.remove(address)

Also, You may be interested in the GLOBAL_BAN_LIST implementation to be
in the latest (2.1.21) Mailman release. See
<http://bazaar.launchpad.net/~mailman-coders/mailman/2.1/revision/1574>.


>  > What is the correct format to ban all addresses in a domain? 
>  > *@domain.com didn't seem to do it for me.
> 
> Regular expression.  "*" is not a wildcard in a regular expression, it
> is a repetition operator.  The wildcard for "any character" is a
> period.  To match any string (including the empty string), use ".*".
> To get a literal period, you quote it with "\".  To ban all addresses
> in a particular domain, use ".*@domain\.com$".  If there are multiple
> periods, you should quote them all with backslashes.


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_addr...@domain.com.

-- 
Mark Sapiro <m...@msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list Mailman-Users@python.org
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