CRON ISSUES SENDING MAIL WITH CMSB 3.50 OR EARLIER, AND PHP 7.2 AFTER A BLUEHOST SERVER UPGRADE - May 28th, 2019
|
About a month ago, I moved an account to a new server at Bluehost, and I started having major problems with sending emails using a cron job.
After weeks of playing around, many days waiting for Bluehost's senior level support, and hours of Daniel Loewe and Dave Edis' time, The issue of why emails were never received when using a mailarray or an email template, is solved. (The problem didn't affect phpmail)
Bluehost narrowed it down to Message-ID issues similar to: <65812fc901465e02d09689bdaf6a902f@swift.generated>.
Seems, according to Dave Edis, the senior guru at Interactive Tools, (as well as I understand it) if there's no $_SERVER['SERVER_NAME'] set. See: https://forge.typo3.org/issues/24686, a header is generated by the swift mail program.
Daniel worked up a fix, and at least part of it will be rolled out in a future version of CMSB
Here's the fix that Daniel created.
1) Add your domain name to the end of your cron job (after a space, and no http or www) 2) Add the following code to the top of the cron.php file (above "//load viewer library" code) (i put mine after the load viewer library code by mistake and it still worked)
if (empty($_SERVER['HTTP_HOST']) && isset( $_SERVER['argv'][1])) { $_SERVER['SERVER_NAME'] = $_SERVER['argv'][1]; // set server name for SwiftMailer Message-ID in cron tasks // (https://forge.typo3.org/issues/24686) }
3) Add the same code to any page that addresses CMSB's sendMessage() function from outside the background task framework (like mailarray or email template triggering scripts)
Daniel said, "The extra code should only be necessary when using CMSB's sendMessage() function. it's worth noting that this fix will be in cron.php in a future CMSB version (either 3.51 or 3.52), so after that, it will only be applicable for users setting up cron jobs that use sendMessage() outside of CMSB's background tasks or users on older versions."
Hope this save someone a bit of aggravation....
|
The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact
Interactive Tools for information on the downloading of the software or the purchasing of licenses.