2 #***************************************************************************
3 #* Copyright (C) 2003-2011 Polytechnique.org *
4 #* http://opensource.polytechnique.org/ *
6 #* This program is free software; you can redistribute it and/or modify *
7 #* it under the terms of the GNU General Public License as published by *
8 #* the Free Software Foundation; either version 2 of the License, or *
9 #* (at your option) any later version. *
11 #* This program is distributed in the hope that it will be useful, *
12 #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 #* GNU General Public License for more details. *
16 #* You should have received a copy of the GNU General Public License *
17 #* along with this program; if not, write to the Free Software *
18 #* Foundation, Inc., *
19 #* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 #***************************************************************************
22 import base64
, MySQLdb
, os
, getopt
, sys
, MySQLdb
.converters
, sha
24 sys
.path
.append('/usr/lib/mailman/bin')
26 from pwd
import getpwnam
27 from grp
import getgrnam
29 from SimpleXMLRPCServer
import SimpleXMLRPCServer
30 from SimpleXMLRPCServer
import SimpleXMLRPCRequestHandler
33 from Mailman
import MailList
34 from Mailman
import Utils
35 from Mailman
import Message
36 from Mailman
import Errors
37 from Mailman
import mm_cfg
38 from Mailman
import i18n
39 from Mailman
.UserDesc
import UserDesc
40 from Mailman
.ListAdmin
import readMessage
41 from email
.Iterators
import typed_subpart_iterator
43 names
= Utils
.list_names()
44 for listname
in names
:
46 mlist
= MailList
.MailList(listname
,lock
=0)
48 print 'ERROR '+listname
51 print 'BEGIN '+listname
53 mlist
.header_filter_rules
= []
54 mlist
.header_filter_rules
.append(('X-Spam-Flag: Yes, tests=bogofilter', mm_cfg
.HOLD
, False))
55 print ' set new bogofilter policy'
61 print 'ERROR '+listname