On 12/01/2014 07:55 AM, Jon 1234 wrote: > Would it be possible to implement a custom Mailman handler for this? > > If email is from a particular email address & to a particular list: > - Create flat file from MySQL query > - Run sync_members using that file > - Email the email address detailing the changes made
Yes. > Before I try to reinvent the wheel - is there a script for this already out > there? 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 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). If you want to do this via a triggering email as you propose rather than cron, you could still use a shell script such as mine and invoke it from your handler, or skip the script and just invoke something to get the list and then invoke sync_members on the list -- Mark Sapiro <m...@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan ------------------------------------------------------ Mailman-Users mailing list Mailman-Users@python.org https://mail.python.org/mailman/listinfo/mailman-users Mailman FAQ: http://wiki.list.org/x/AgA3 Security Policy: http://wiki.list.org/x/QIA9 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/ Unsubscribe: https://mail.python.org/mailman/options/mailman-users/archive%40jab.org