[Mailman-Users] nomail.py: print users with 'nomail' option set

Dan Mick Dan.Mick at West.Sun.COM
Sat May 27 07:18:07 CEST 2000


Here's a little Python fragment to be used with bin/withlist.
It shows all members whose "nomail" flag is turned on (so, perhaps,
you can send a reminder email that they've been disabled).

Use with "python -i bin/withlist -r nomail.nomail <listname>".

Anyone who cares to mention why there are some users mentioned in
members[] or digest_members[] who are *not* present in user_options[],
I'd be happy to hear about it (that's why the try/except stuff is
necessary).

I put this in my ~mailman directory.

Any comments welcome.

---

import sys
import Mailman.mm_cfg

def nomail(list):

   for member in list.members.keys():
      try:
         if list.user_options[member] & Mailman.mm_cfg.DisableDelivery:
            print member
      except:
         pass

   for member in list.digest_members.keys():
      try:
         if list.user_options[member] & Mailman.mm_cfg.DisableDelivery:
            print member
      except:
         pass
   sys.exit(0)





More information about the Mailman-Users mailing list