Chris Waltham wrote: > >A couple of days ago I was troubleshooting an issue for a user and >noticed that the "nomail" option was set for them in a particular >list. Obviously, because of this, they weren't getting any mail; I >presume the flag was set because of bounces.
Maybe. In 2.0, you can't tell for sure. >My question is this: is >there any way that, from the command-line, I can generate a list of >users who have a particular flag set -- like the "nomail" flag -- from >the command-line? My overall goal is to be able to run a script >against every mailing list we have to print me the users with the >"nomail" flag set. Yet another reason to upgrade. The 2.1.x bin/list_members does this. For 2.0.x, you could modify list_members to add an option similar to 2.1's --nomail, or you could create a simple script along the lines of: --------------------------------------------------------------------- #! /usr/bin/env python # This is for Mailman 2.0.x only import paths from Mailman import MailList from Mailman import mm_cfg from Mailman import Utils for list in Utils.list_names(): mlist = MailList.MailList(list, lock=0) users = [] for user in mlist.GetMembers() + mlist.GetDigestMembers(): if mlist.GetUserOption(user, mm_cfg.DisableDelivery): users.append(user) if users: users.sort() print 'Nomail users for list: %s' % mlist.real_name for user in users: print ' %s' % user --------------------------------------------------------------------- Save this in Mailman's bin/ directory and run it. I can't test it completely because it uses Mailman 2.0.x methods which don't exist in 2.1.x, but I think it will work, and if it doesn't, it won't do any damage. -- Mark Sapiro <[EMAIL PROTECTED]> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org 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