Sendmail limits for emails in forum_cron

Sendmail limits for emails in forum_cron

by Ken Brock -
Number of replies: 0

I am using Moodle 1.4.3 on a Linux server using sendmail but my ISP has a limit of 5 emails per 10 seconds and 100 email per hour. When I post to forums or discussions with more than 5 subscribers and the forum_cron lights off in /mod/forum/lib.php, 5 emails go through and the rest return error with "ERROR: Could not instantiate mail function" and its ugly twin "ERROR: mod/forum/cron.php".

 

Has anyone had this same problem and rewritten forum_cron with its two functions forum_get_unmailed_posts and forum_mark_old_posts_as_mailed to have a "chunking" function where you only issue "N" sendmails per cron call? The way these two functions are written now, they assume that all emails for all forums and discussions will be successful. There can be many e-mails launched per cron call. For my case I would like to throttle 5 emails each time cron went off every 5 minutes. Adding a simple "LIMIT 0,5;" to forum_get_unmailed_posts and his partner in crime will not do it because of the variable number of emails generated by a variable number of posts.

 

Please let me know if someone has put a throttle into forum_cron.

Average of ratings: -