[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: seeking mailing list from SQL



On Thursday 02 October 2003 15:11, martin f krafft wrote:
> also sprach Mark Ferlatte <ferlatte@cryptio.net> [2003.10.02.2156 
+0200]:
> > remove_members --all mylist
> > mysql -h localhost -e "SELECT email from people" mydb | \
> > 	add_members -n - -c n -w n mylist
>
> I know about the script possibility, but what then if someone
> unsubscribes from the mailinglist a minute before a new mail is
> sent. People get annoyed about these things, trust me. And I can't
> run a cron script every minute. I'd much rather have the mailing
> list manager contact the database when it's needed.

what if someone hits send to unsubscribe while their smtp server is 
recieving an email from the list.  there is technically no way to 
make it work 100% corrently if your taking that into account.  
some mailing list i've been on have something about 'allow an hour 
for removal' (or sometimes day, days, a week)

> How about a trigger in the database that runs the script ? I never
> tried it, but it should work

mysql doesn't support triggers last time i looked, but that is a good 
idea, have a 'processed' flag in the table, and a cron script to add 
new and delete old records from the mailing list and update the table 
as such.

maybe adding a column like:
`status` enum('subscribed','pending','unsubscribed','removed');
subscribed - in the list, mail server knows it
pending - not in the list, needs to be added to the list
unsubscribed - want off the list, mail server needs to remove them
removed - off the list.  technically you could then remove those 
records, if you had no further need of them.



Reply to: