1

Group emails from one of my CiviCRM installations are not being delivered (ever), which has caused some embarrassment. Messages can be composed as usual, but are never scheduled and there's no "runner" display. Pausing and restarting the mailing results in the status changing from "Scheduled" to "Running" and clicking "Report" shows the expected number of intended recipients but the "Successful Deliveries" count is always zero. In case it's relevant, I did notice that the option to send "immediately" is not selected by default (which I think it always is on sites that work), but it can be selected manually.

Obviously, I have enabled the "Send Scheduled Mailings" job and tried triggering that both manually and from a cron job. The log shows success but with a count of zero.

I have also tried obvious things like disabling all extensions, resetting caches and paths, comparing all settings with other installations that do work, searching the forums, bug reports and so on. I've checked that outgoing mail is configured correctly and I can send test emails. There's nothing in the error logs. Nothing makes any difference, it seems to be a bug.

The problem is reproducible in the sense that it's not intermittent, but I haven't been able to reproduce it on a clean installation.

I'd be prepared to move everything to a new installation to work around this but it's a heavily used instance with lots of contacts, invoices and so on and I know of no way to export all those and reimport them later to a working instance. Everything else seems to be working as usual.

Reproduction steps

  • Create a group containing some test contacts.
  • Go to Mailing > New Mailing and compose a test message, with the group from the previous step selected as Recipients.
  • Click Send test and check that a test message is correctly delivered.
  • Click Next then select Immediately or a date and time 5 minutes in the future.
  • Click Submit Mailing.
  • Wait for cron to run or go to System Settings > Scheduled Jobs and trigger Send Scheduled Mailings. Check that the result is success.
  • Check that the message is now in Mailing > Scheduled and Sent Mailings. Click Report. Observe that Intended recipients is not zero but Successful deliveries is always zero.

Current behaviour

Nothing happens. No messages delivered, nothing in error logs.

Expected behaviour

Messages are sent once the scheduled job is triggered, perhaps with a batch limit. Eventually the whole job completes and the status changes to "Completed".

Environment information

Browser: Chrome 114.0.5735.135 CiviCRM: Master/5.62.1 PHP: 8.1 CMS: WordPress 6.2.2 running on Ubuntu 22.04 Database: MariaDB 10.6.12 Web Server: OpenLiteSpeed 1.7.17

Updates

The mailing report shows "Status: Scheduled" even though the schedule is in the past and a manual "Send Scheduled Mailings" job has been triggered and reports success. This looks like a scheduling issue.

Having turned on "NOTICE" PHP debugging I see dozens of "Undefined array key" warnings. As far as I can tell they shouldn't be causing this problem and there's no easy way to fix them, but here are the first few examples in case it's relevant:

2023-10-07 15:22:44.774502 [NOTICE] [3336769] [2a00:23c4:80aa:9901:6d1d:6953:a92e:8aa2:55029:HTTP2-273#beechesit] [STDERR] PHP Warning: Undefined array key "campaign" in /home/beechesit/public_html/wp-content/uploads/civicrm/templates_c/en_GB/%%CA/CA3/CA322A60%%Report.tpl.php on line 147

Another update in case it's relevant: I moved the installation to a new server and now I'm seeing these errors when running the CiviCRM cron job:

PHP Warning: Undefined property: CRM_Core_DAO::$mailing_id in /home/beechesit/public_html/wp-content/plugins/civicrm/civicrm/CRM/Mailing/Event/BAO/MailingEventQueue.php on line 41

Another update in case it's relevant - the "Notes" tab has disappeared from all my contacts.

I'm trying to move everything to a fresh installation but it's a very complicated process! In particular, it's hard to match contributions to contacts and a lot of information is not exportable and is being lost, for example creation dates. This has become a disaster :-(

2
  • Update: Outgoing mail is currently set to use /usr/sbin/sendmail (which in turn uses PostFix, I believe). I do have access to the mail logs but there's nothing relevant - no outgoing mail attempt (the dog that didn't bark!), except when I use "Send Test" in CiviCRM, which is fine. I don't think it's a problem with the mail infrastructure because of that, and also because moving the whole (WordPress) site to a new server hasn't helped. The other "working instances" I mentioned are also on the same VPS, which rules out a lot of possibilities. Jun 28, 2023 at 20:22
  • In case it helps, this is the log message after the sheduled job is triggered manually. Finished execution of Send Scheduled Mailings with result: Success (a:1:{s:9:"processed";i:0;}) Jun 29, 2023 at 23:40

1 Answer 1

1

If the mail never went out, it's likely that there's a crash occurring during the sending of the mail. This can be particularly difficult to track down, but there is often an entry in your PHP log (or WP debug log, if it's enabled). More rarely, there's an entry in the CiviCRM "ConfigAndLog" log.

If you have Smarty processing for CiviMail enabled, you may want to disable it to see if the problem persists - the most common cause I've seen for a crash here is that there's malformed Smarty in an email.

Another cause I've seen is an unusual SMTP response from the server - though in your case we can rule that out.

Some more info to help with troubleshooting:

  • Does the problem occur on a very simple test message?
  • If you find PHP errors in the log, please share.
16
  • Another cause - not relevant in your case - is a mismatch of PHP versions or modules between command-line and web-based PHP. For instance, a password encrypted with libsodium won't work if you don't have libsodium present in your command-line PHP. Jun 28, 2023 at 21:15
  • Thanks, that's helpful. Yes, the problem occurs with a very simple test, but you've made me wonder if the unsubscribe link is triggering it somehow. There are no relevant errors that I can see in any log including the PHP log or the browser console. If I get a chance I'll enable more debug logging but I don't want to disrupt a production site and also I'm travelling and not sure how much internet access I will have for the next few days. Jun 29, 2023 at 23:15
  • Picking this up again because it's still a problem and I have some PHP errors to report. 2023-10-07 15:22:44.774502 [NOTICE] [3336769] [2a00:23c4:80aa:9901:6d1d:6953:a92e:8aa2:55029:HTTP2-273#beechesit] [STDERR] PHP Warning: Undefined array key "campaign" in /home/beechesit/public_html/wp-content/uploads/civicrm/templates_c/en_GB/%%CA/CA3/CA322A60%%Report.tpl.php on line 147 Oct 7, 2023 at 14:28
  • Also possibly relevant: Clicking the "report" link on a simple test mailing shows Status: Scheduled Even though the time is in the past and a manually triggered "Send Scheduled Mailings" job has reported success. This looks like a problem with the scheduling system. Oct 7, 2023 at 14:32
  • Update regarding Smarty: I don't use any smarty tokens in the test emails, but I couldn't find a way to disable Smarty processing completely. Is that even possible? Oct 7, 2023 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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