diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index a4dc3de8bc8a..8721c943fdce 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -227,7 +227,7 @@ public static function _process($civiMail, $dao, $is_create_activities) { // if its the activities that needs to be processed .. try { $createContact = !($dao->is_contact_creation_disabled_if_no_match ?? FALSE); - $mailParams = CRM_Utils_Mail_Incoming::parseMailingObject($mail, $createContact); + $mailParams = CRM_Utils_Mail_Incoming::parseMailingObject($mail, $createContact, FALSE); } catch (Exception $e) { echo $e->getMessage(); diff --git a/CRM/Utils/Mail/Incoming.php b/CRM/Utils/Mail/Incoming.php index 82dd61bf00e0..6a2a35206193 100644 --- a/CRM/Utils/Mail/Incoming.php +++ b/CRM/Utils/Mail/Incoming.php @@ -323,10 +323,11 @@ public function &parse(&$file) { /** * @param $mail * @param $createContact + * @param $requireContact * * @return array */ - public static function parseMailingObject(&$mail, $createContact = TRUE) { + public static function parseMailingObject(&$mail, $createContact = TRUE, $requireContact = TRUE) { $config = CRM_Core_Config::singleton(); @@ -347,7 +348,7 @@ public static function parseMailingObject(&$mail, $createContact = TRUE) { // we definitely need a contact id for the from address // if we dont have one, skip this email - if (empty($params['from']['id'])) { + if ($requireContact && empty($params['from']['id'])) { return NULL; }