# Copyright (C) 2006 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # USA. """Add an email address or regexp to ban_list for all lists. Save as bin/add_banned.py Run via bin/withlist -a -r add_banned -- where is the actual email address or regexp to be added to ban_list for all lists. """ def add_banned(mlist, address): if not mlist.Locked(): mlist.Lock() mlist.ban_list.append(address) mlist.Save() mlist.Unlock()