Delete all members with nomail[B]
Howdy,
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.
-- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com
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 Finalizing
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark,
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.
Hmmm. "N" is set to zero, so it seems like they should have already been removed. No?
-- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com
Josh Berkus quoted me and wrote:
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.
Hmmm. "N" is set to zero, so it seems like they should have already been removed. No?
That depends. If bounce_you_are_disabled_warnings was set to zero at the time of the user's first bounce, then the user should have been removed when her bounce score reached bounce_score_threshold rather than setting her delivery nomail[B]. However, if it was non-zero at the time of the first recorded bounce, that is the value that was saved for that user at that time and subsequent changes to bounce_you_are_disabled_warnings have no effect for that user.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mark,
That depends. If bounce_you_are_disabled_warnings was set to zero at the time of the user's first bounce, then the user should have been removed when her bounce score reached bounce_score_threshold rather than setting her delivery nomail[B]. However, if it was non-zero at the time of the first recorded bounce, that is the value that was saved for that user at that time and subsequent changes to bounce_you_are_disabled_warnings have no effect for that user.
Ok, that's probably what happened. So if I wait a couple weeks, these users should all gradually go away.
I will keep your withlist script around in case I want to delete users who are voluntarily nomail. We have quite a few users who go nomail, and then forget they ever subscribed ...
-- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com
On 11/4/2012 6:22 PM, Josh Berkus wrote:
However, if it was non-zero at the time of the first recorded bounce, that is the value that was saved for that user at that time and subsequent changes to bounce_you_are_disabled_warnings have no effect for that user.
Ok, that's probably what happened. So if I wait a couple weeks, these users should all gradually go away.
Assuming cron/disabled is being run, yes, that is the case.
I will keep your withlist script around in case I want to delete users who are voluntarily nomail. We have quite a few users who go nomail, and then forget they ever subscribed ...
You'd need to change MemberAdaptor.BYBOUNCE in that script to MemberAdaptor.BYUSER to delete members who set themselves to nomail.
However, it occurs to me that there is a better way than my possibly error prone withlist method. Consider
cd to Mailman's bin directory ./list_members -n bybounce LISTNAME | ./remove_members -f - LISTNAME
or
./list_members -n byuser LISTNAME | ./remove_members -f - LISTNAME
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Josh Berkus
-
Mark Sapiro