[Mailman-Users] moderation bit silently turns off on some lists

Michael McAndrew michaelmcandrew at gmail.com
Sun Sep 16 12:53:42 CEST 2007


Hi there,

I operate a number of mailing lists.  Some of these lists are announce only
lists.  The annouce only lists work by setting everyone's moderation bit to
1 apart from those that have posting permission.  This is done
automatically by a script that takes its data from a remote database via a
text file that is created when requested.  (and yes, I know that's a long
winded way of doing things!)

But every now and again on some lists (its only happened so far on large
lists) all the moderation bits are set to 0 allowing anyone to post.  Any
ideas why this would be?

Below are the script that sets posting permissions [A] and a sample of the
text file that inputs into this script [B].

Any ideas why this would happen?  As always, many thanks if you can help.

PS I don't blame you if you tell me to use a simpler solution.  In fact, I
agree and I am completley redoing the project getting rid of the manual
synching and using default mailman admin interface.  But in the mean time it
is still a problem that I would be really grateful if someone could help me
find a solution to.

[A]
from Mailman.Errors import NotAMemberError
from Mailman import mm_cfg
from os.path import isfile

whoCanPostListsData = []

if isfile('vawupdate/scripts/vaw_wcp.txt'):
  whoCanPostListsVAWFile = open('vawupdate/scripts/vaw_wcp.txt', 'r')
  for line in whoCanPostListsVAWFile:
    whoCanPostListsData.append(line.strip().split("/"))

def wcpupdate(mlist):
  global whoCanPostListsData
  if not mlist.Locked():
    mlist.Lock()
  for whoCanPostLine in whoCanPostListsData:
    if mlist.internal_name()==whoCanPostLine[0]:
      if whoCanPostLine[2]=='0':
        mlist.setMemberOption(whoCanPostLine[1].strip(), mm_cfg.Moderate,
mm_cfg.No)
      else:
        mlist.setMemberOption(whoCanPostLine[1].strip(), mm_cfg.Moderate,
mm_cfg.Yes)
      print whoCanPostLine[1], ' set'
  mlist.Save()
  mlist.Unlock()
[/A]

[B]
bme/person1 at example.org/1
bme/person2 at example.org/1
bme/person3 at example.org/1
bme/person4 at example.net/1
bme/person5 at example.net/1
bme/michaelmcandrew at gmail.com/0
[/B]


More information about the Mailman-Users mailing list