From: SourceForge.net <no...@so...> - 2007-11-26 03:15:57
|
/mod/mailinglists item #1838406, was opened at 2007-11-25 22:16 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=765094&aid=1838406&group_id=81360 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Support Request Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Josh Curry (joshcurry) Assigned to: Greg Meiste (blindman1344) Summary: Throttle/Queue Mail Sending in mod Mailinglists Initial Comment: Many ISPs now limit the number of emails that a script can send per hour. So, to remedy this problem I would like to see a mail queue/throttle implemented in the mailinglists module. Although I am not a php programmer, here is a patch that I currently use to throttle the outgoing email sent by phpmailinglists (v. 0.5.6) in phpwebsite 0.10.1. Not all emails are throttled, only emails sent to the mailing lists are queued; subscribe and unsubscribe requests are still emailed when submitted. As far as I can tell, there are no issues with this implementation. I used the Pear Mail_Queue package (http://pear.php.net/package/Mail_Queue) to write this patch. Mail_Queue is not installed in phwebsite by default and it will need to be copied to your lib/pear/Mail directory. The end-user documentation I followed is located here: http://pear.php.net/manual/en/package.mail.mail-queue.php. Basically, the setup is as follows. 1) Create the necessary tables in your database using the mail_queue_create_table.sql file. You can change the table name at the top of this file to correspond to your naming scheme. If you do so, remember to do so in the queue_config.php file. 2) Modify the queue_config.php file as indicated in that file's comments. Basically, you need to specify the mail and my sql settings you use. 3) Modify the queue_send.php file to set your timezone and mailing rate (I use 185 mails per hour because my host limits scripts to 200 emails per hour). You may also need to add the timezone line to the the phpwebsite index.php file if you don't already set your timezone this way. I already do, so this wasn't a problem, but it did crop up as an issue when my queue_send.php file was called because it was using the server's timezone and not my website's timezone (server is west coast, website is run for an east coast organization). 4) Patch the class/phpmailinglists.php file using the mailqueue.patch file. 5) Set cron to access your queue_send.php file each hour (I use @houly /usr/bin/lynx -source http://path.to/mailinglists/class/queue_send.php). I assume that you could also do this on windows. This has worked well for me, but like I said, I'm not a programmer and I'm not that familiar with this module. If anyone notices any bugs or has suggestions on making this better, please let me know. I hope this helps get a mail queue implemented faster. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=765094&aid=1838406&group_id=81360 |