[Mailman-Users] Post-subscription processing

Mark Sapiro mark at msapiro.net
Fri Aug 16 05:24:15 CEST 2013


On 08/15/2013 07:17 PM, Jim Popovitch wrote:
> What's the sanest way to export a list of current subscribers
> everytime there is a new subscriber?   I want to maintain a table of
> current list members (for postfix to reject if to:list !=
> from:subscriber)


How about unsubscribes? Changes of address? I would suggest that the
most reliable way is to put hooks in the Mailman/OldStyleMemberships.py
member adaptor routines addNewMember and removeMember. This will get
changes of address too because that is done by a remove and add.

Another is to create something that would parse the subscribe log and
get those list names that have entries with time stamps later than the
last run and do bin/list_members for those lists, and run it frequently
via cron. This has the advantage of not modifying Mailman, but has the
drawback that address changes aren't logged (unless you are running
<https://code.launchpad.net/~mailman-coders/mailman/2.2>), and there may
be log rotation issues to deal with.

If you have lots of excess resources, you could just run
bin/list_members for all lists at frequent intervals via cron. e.g.

#!/bin/bash
for list in `/path/to/bin/list_lists --bare`; do
  /path/to/bin/list_members $list > /path/to/${list}_member_list
done

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