[Mailman-Users] Delete all members with nomail[B]

Mark Sapiro mark at msapiro.net
Sun Nov 4 17:32:10 CET 2012

Josh Berkus wrote:
>I have a mailman list with 3200 members, about 900 of which are now
>nomail[B] from bounces.  I'd like to know how to purge all the nomail[B]
>members from the list -- without spending an entire day doing it through
>the GUI.

If Mailman's cron/disabled script is being run daily by cron as it
should be, a nomail[B] member will receive a total of N warnings at
intervals of D days and then will be automatically removed.

N = the lists bounce_you_are_disabled_warnings setting
D = the lists bounce_you_are_disabled_warnings_interval setting

If members aren't being removed N*D days after delivery is initially
disabled by bounce, cron/disabled isn't running or is encountering
errors. The errors should be mailed by cron to the Mailman user unless
MAILTO is set to something else on the crontab. The problem here is
mail to the Mailman user often ends up being delivered to to site list
and if the site list doesn't accept mail from non-members, that mail
can be lost.

If after digesting the above you still want to remove nomail[B] members
manually, you can do it with withlist as in:

mmp/bin/withlist -l LISTNAME
Loading list LISTNAME (locked)
The variable `m' is the LISTNAME MailList instance
>>> from Mailman import MemberAdaptor
>>> for member in m.getDeliveryStatusMembers(status=[MemberAdaptor.BYBOUNCE]):
...     m.removeMember(member)
>>> m.Save()
>>>                    (type control-D here to exit)
Unlocking (but not saving) list: gpc-test

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list