6

When using Civi Mail, we have a recurring issue wherein the system stops sending emails at 500 sends. The job shows as incomplete.

It is not a php timeout, as the hosting company (https://www.rochen.com/) has increased all our limits during testing, with no change.

We can re-initiate the mail send, and it will send out the next set of 500 emails, then stop again. We have to continue manually triggering the send to get the full job completed.

Any thoughts on the culprit?

System info: CiviCRM 4.2.6 Joomla 2.5.28 php 5.3.29 MySQL 5.5.42-cli

  • 2
    Have you checked your cron setup? Without cron running you'll always be limited by whatever batch size you set. – artfulrobot Mar 24 '15 at 16:02
  • We have. It runs as scheduled, and nothing's changed in the cron since we set up the site, yet this problem just started. – Joseph Cotten Mar 25 '15 at 16:15
  • We're sending 500 per cron execution, and the cron executes every 10 minutes, which means 3,000 per hour. I don't want to risk getting blacklisted by sending out much more than that per hour. – Joseph Cotten Mar 25 '15 at 18:50
11

Check Administer menu > CiviMail > Mailer Settings, and see if the "Mailer Batch Limit" is set to 500.

  • 2
    Here is the direct link to the "Mailer Settings" page: <<yourdomain>>/civicrm/admin/mail?reset=1 – Pamela Mar 24 '15 at 16:04
  • The Batch Limit is indeed set to 500. Is it safe to set it to 0 (unlimited)? Our server's pretty beefy. – Joseph Cotten Mar 25 '15 at 16:17
  • 1
    @JosephCotten - yeah, I always leave it at 0 unless the webhost/ESP is throttling e-mail. I haven't seen a mailing over 38K e-mails, but I've had no problem up to that amount! Though the default is 0, so I'd try to find out who set it to 500 and why. – Jon G - Megaphone Tech Mar 26 '15 at 2:30
9

Sounds like a cron/scheduled tasks issue.

CiviCRM has a scheduled tasks system to organise jobs that need running at regular intervals. This in turn requires that something pokes it into action frequently (e.g. every 15 mins). Typically on Linux this is done with the system's cron utility.

Without CiviCRM being given chance to run its scheduled tasks, it will only ever do one batch - there's nothing to give it chance to run a second batch.

Setting this up is detailed in the book and on the wiki.

In brief, if you're on Linux + Drupal hosting, then you want a line like this in /etc/crontab

*/15 * *   *   *   <USER>  umask 0002; /usr/bin/php /var/www/your.civi.site/sites/all/modules/civicrm/bin/cli.php -j -s <example.com> -u admin -p '<DATABASE PASSWORD>' -e Job -a execute

Nb. you might like to put those commands in another shell script and then just reference that so as to avoid your database password entering your syslog.

  • Generally you can use crontab to list and manage crons: crontab -l to list for the current user, crontab -e to edit crontabs for the current user – gboudrias Mar 24 '15 at 23:41
  • Can you explain the F in -p 'F<DATABASE PASSWORD>' ? – Joe Murray Mar 7 '18 at 20:43
  • Yes. All passwords must begin with F. To do otherwise it's a grave security mistake. Um, no, it was a typo! I've removed it, thanks! – artfulrobot Mar 8 '18 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.