From d488ca2070a01e2dae2df3ad3a8b15b227dbd6ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Apr 2024 09:23:40 +0200 Subject: [PATCH] FIX #26015 --- htdocs/emailcollector/class/emailcollector.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 21aec87bc9f..25cc8a45fe7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1683,6 +1683,7 @@ class EmailCollector extends CommonObject $operationslog .= " - ".dol_escape_htmltag((string) $imapemail); } $operationslog .= " - References: ".dol_escape_htmltag($headers['References']??'')." - Subject: ".dol_escape_htmltag($headers['Subject']); + dol_syslog("** Process email ".$iforemailloop." References: ".($headers['References']??'')." Subject: ".$headers['Subject']); @@ -1703,7 +1704,7 @@ class EmailCollector extends CommonObject if (empty($trackidfoundintorecipienttype)) { if (empty($headers['References']) || !preg_match('/@'.preg_quote($host, '/').'/', $headers['References'])) { $nbemailprocessed++; - dol_syslog(" Discarded - No suffix in email recipient and no Header References found matching signature of application so with a trackid"); + dol_syslog(" Discarded - No suffix in email recipient and no Header References found matching the signature of the application, so with a trackid coming from the application"); continue; // Exclude email } } @@ -2048,7 +2049,7 @@ class EmailCollector extends CommonObject }*/ } elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) { // This is an external reference, we check if we have it in our database - if (!is_object($objectemail)) { + if (!is_object($objectemail) && isModEnabled('ticket')) { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."ticket where email_msgid = '".$this->db->escape($reg[1])."'"; $resql = $this->db->query($sql); if ($resql) { @@ -2063,7 +2064,7 @@ class EmailCollector extends CommonObject } } - if (!is_object($objectemail)) { + if (!is_object($objectemail) && isModEnabled('project')) { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."projet where email_msgid = '".$this->db->escape($reg[1])."'"; $resql = $this->db->query($sql); if ($resql) { @@ -2078,7 +2079,7 @@ class EmailCollector extends CommonObject } } - if (!is_object($objectemail)) { + if (!is_object($objectemail) && isModEnabled('recruitment')) { $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature where email_msgid = '".$this->db->escape($reg[1])."'"; $resql = $this->db->query($sql); if ($resql) {