[Mailman-Users] syncing recipients from an sql database / managing bounces

Jo‹ao Sá Marta samarta at ci.uc.pt
Wed Apr 9 10:32:36 CEST 2008


Hi

Zbigniew Szalbot escreveu:
> Hello,
>
> We have an sql database of users who we would like to contact from
> time to time. So far we have been doing it outside of mailman realm. I
> would like to sync the sql user database to a mailing list and then
> send them a newsletter. The primary reason for this is that manual
> bounce management is quite a tedious process.
>
> Is there a way to sync the database in such a way as to only update
> records rather than delete all users from mailman and import them from
> scratch?
Yes, using /home/mailman/bin/sync_members


>  And what if a given record has been deleted in the sql
> database? Will it also be deleted from mailman user database upon
> importing/syncing?
>   

Yes.

I use a script to sync a lot of my lists

#!/bin/bash
#script to sync a mailing list named mailing_list
Data=`/bin/date +"%Y_%m_%d %T"`
day=`/bin/date +"%Y_%m_%d"`
hour=`/bin/date +"%H%M"`

LOGFILE="/home/admin/scripts_mailing_lists/$day""_mailing_list_sync.log"
nomefich="/home/admin/scripts_mailing_lists/$day""_mailing_list.log"
your_mysql_querie_goes here >$nomefich
#only sync if data were obtained to prevent conectivity losses because 
in our case the mysql server
# is a remote server
if [ `cat $nomefich | wc -l` > 0 ]; then
    /home/mailman/bin/sync_members -w=no -g=no -a=no -f $nomefich 
mailing_list >$LOGFILE
fi

> Many thanks!
>
>   


-- 

===============================|===================================

= Joao Sa Marta                |          Email: samarta at ci.uc.pt =

= Centro de Informatica        |        Tel: 239 853178 (directo) =

= da Universidade de           |          Tel: 239 853170 (Geral) =

= Coimbra                      |                  Fax: 239 853189 =

= Apartado 3080                | http://www.uc.pt/pessoal/samarta =

= 3001-401 Coimbra             |                                  =

===============================|===================================



More information about the Mailman-Users mailing list