[Mailman-Users] how to discard bounced messages?

Mark Sapiro mark at msapiro.net
Thu Apr 16 17:42:24 CEST 2009


Danil Smirnov wrote:
>
>2009/4/16 Mark Sapiro <mark at msapiro.net>
>
>>
>> You need to individually mark each request "discard" in the admindb
>> interface and "Submit All Data". There is no bulk removal method or
>> tool for subscription requests. You need to do this often enough to
>> prevent the number of outstanding requests from growing so large that
>> the admindb interface times out before loading the page.
>
>
>But I've got 1 thousand spammer`s request in 3 days!!! May be I can just
>switch off subscription service at all? My list is announcement list so I
>need no subscription service... Please advice how can I do that...


I suspect what is happening is that spammers are not deliberately
trying to subscribe in order to spam your list. Rather, I think that
spammers are just spamming your LISTNAME-subscribe and LISTNAME-join
addresses resulting in subscription requests.

There are a few things you can do.

You can just periodically discard all requests by removing the
lists/LISTNAME/request.pck file.

You can modify cron/checkdbs [1] to apply max_days_to_hold to subscribe
requests as well as messages.

Depending on your MTA, you can just remove the aliases for
LISTNAME-request and LISTNAME-join. This is probably best as it will
return a failure to the spammer at SMTP time

[1] To modify cron/checkdbs, add the line

    heldmsgs.extend(mlist.GetSubscriptionIds())

to the definition

def auto_discard(mlist):
    # Discard old held messages
    discard_count = 0
    expire = mlist.max_days_to_hold * 86400 # days
    heldmsgs = mlist.GetHeldMessageIds()
    if expire and len(heldmsgs):
        for id in heldmsgs:
            if now - mlist.GetRecord(id)[0] > expire:
                mlist.HandleRequest(id, mm_cfg.DISCARD)
                discard_count += 1
        mlist.Save()
    return discard_count

so it becomes

def auto_discard(mlist):
    # Discard old held messages
    discard_count = 0
    expire = mlist.max_days_to_hold * 86400 # days
    heldmsgs = mlist.GetHeldMessageIds()
    heldmsgs.extend(mlist.GetSubscriptionIds())
    if expire and len(heldmsgs):
        for id in heldmsgs:
            if now - mlist.GetRecord(id)[0] > expire:
                mlist.HandleRequest(id, mm_cfg.DISCARD)
                discard_count += 1
        mlist.Save()
    return discard_count


-- 
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