[Mailman-Users] Mailman handler to run sync_members
jon.1234 at hotmail.co.uk
Fri Dec 5 02:55:20 CET 2014
> Date: Mon, 1 Dec 2014 17:39:30 -0800
> From: mark at msapiro.net
> I do this differently. I just run a daily cron does something like:
> #! /bin/bash
> /home/mark/.cron/get_memb | \
> /usr/local/mailman/bin/sync_members -w=yes -g=no -a=no -f - gpc-announce
This sounds like a good idea (especially if it ever ceases to be announcement-only).
> get_memb happens to be a python script which uses the MySQL-python
> package <https://pypi.python.org/pypi/MySQL-python/> to access the MySQL
> database and extract a list of
> First Last <email>
> entries for all current members of my bike club from our database and
> gpc-announce is the "all club" announcement list.
> The get_memb script is specific to our database, but it could basically
> be anything, even just a straight MySQL query, that produces the desired
> list (In our case, the logic of determining whether a record in the
> table is that of a current member is complex and in some cases involves
> looking at dates in other records, thus the python script).
That sounds so similar to my situation that I'm going to push my luck, and ask if I could see an anonymised version of your get_memb script - would that be all right? Even the "who is a member?" part would be useful as, while mine would be different, it would help me with learning the necessary Python.
More information about the Mailman-Users