From 5fdd5f80e713ad37459f45056fc35687144e45ad Mon Sep 17 00:00:00 2001 From: David Hayes Date: Sun, 13 Sep 2015 18:03:30 -0500 Subject: [PATCH] Running the fetch_activities cli task stops with a fatal error when the incomming mail parser is unable to determine the ezcMailDeliveryStatus. The fetch_activities task will continue to download and attempt to parse the offending email, dying every time. This prevents other mails from being downloaded and parsed. Error Message: "No clue about the ezcMailDeliveryStatus" This patch catches that error, prints it, marks the offending email ignored, and allows activities processing to continue. --- CRM/Utils/Mail/EmailProcessor.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index 7450684b7b..b83f19aef1 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -238,8 +238,14 @@ class CRM_Utils_Mail_EmailProcessor { // preseve backward compatibility if ($usedfor == 0 || !$civiMail) { - // if its the activities that needs to be processed .. - $mailParams = CRM_Utils_Mail_Incoming::parseMailingObject($mail); + // if its the activities that needs to be processed .. + try { + $mailParams = CRM_Utils_Mail_Incoming::parseMailingObject($mail); + } catch (Exception $e) { + echo $e->getMessage(); + $store->markIgnored($key); + continue; + } require_once 'CRM/Utils/DeprecatedUtils.php'; $params = _civicrm_api3_deprecated_activity_buildmailparams($mailParams, $emailActivityTypeId); -- 2.25.1