diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 21aec87bc9fe2..25cc8a45fe7e7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1683,6 +1683,7 @@ public function doCollectOneCollector($mode = 0) $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 @@ public function doCollectOneCollector($mode = 0) 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 @@ public function doCollectOneCollector($mode = 0) }*/ } 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 @@ public function doCollectOneCollector($mode = 0) } } - 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 @@ public function doCollectOneCollector($mode = 0) } } - 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) {