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/[EMAIL PROTECTED]/1
bme/[EMAIL PROTECTED]/1
bme/[EMAIL PROTECTED]/1
bme/[EMAIL PROTECTED]/1
bme/[EMAIL PROTECTED]/1
bme/[EMAIL PROTECTED]/0
[/B]
------------------------------------------------------
Mailman-Users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://www.python.org/cgi-bin/faqw-mm.py
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
http://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Security Policy: 
http://www.python.org/cgi-bin/faqw-mm.py?req=show&file=faq01.027.htp

Reply via email to