[Mailman-Users] Umbrella/Parent Lists

Wesley T. Perdue wes at greenfieldnetworks.com
Thu May 22 01:52:59 CEST 2003


Jon,

At 10:14 PM 5/20/2003 -0400, Jon Carnes wrote:
>On Thu, 2003-05-08 at 15:51, Wesley T. Perdue wrote:
>
>> My script lacks one feature I need: I'd like it to be driven by membership changes in the child lists, rather than cron-driven.  That is, when someone joins or leaves my software list, I'd like my eng list to be automatically updated.  I'm not a Python programmer (I'm barely a Perl programmer), so it may take me a while to figure out how to implement this feature.  Arbitrarily rebuilding all parent lists on a frequent basis is a waste of resources on my already busy server; plus, it introduces a time delay in the parent-list-updating.
>> 
>I had some clients with that same concern.  The fix is easy.  Modify
>your script (still kicked off by cron), to start with a grep of the
>Mailman log files looking for removes or adds to list memberships. If
>you find any then continue running the script - otherwise exit.
>
>The resources used are minimal if there are no changes to the sub-lists.

True; however, my list memberships change less than once a week, on average.  I also think it's important that the parent lists get updated at roughly the same time the child lists do.

>Once you get brave, you can hack the Mailman cgi code to kick off your
>scripts when there is an add or remove in one of the sub-lists - but the
>cron actually takes up less resources (unless your lists rarely change) 

I'm very close to patching my Perl script into the source.  I've spent my spare time the last week getting familiar with Python and the Mailman source, and I think I've determined where my script should be called.

Whenever a member is added to or deleted from a list, I want Mailman to call my Perl script with the list name as the argument.

It looks like I should do the following. In the file ~mailman/Mailman/MailList.py, in the functions ApprovedAddMember, ApprovedDeleteMember, and ChangeMemberAddress, I should add the following two lines:

        metacmd= '~mailman/scripts/metalist-update.pl' + ' ' + self
        os.system(metacmd)

where metalist-update.pl is my Perl script, and (hopefully) self returns the name of the list currently instantiated.

Does that look correct?

My script determines which parent lists need to be rebuilt (I've been calling them metalists, but I'll probably rename the script before I release it), builds them, and then calls sync-members for each affected list.

>Good Luck - Jon Carnes 

Thanks!

Regards,
Wes





More information about the Mailman-Users mailing list