Skip to content

Commit

Permalink
FIX #26015
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 29, 2024
1 parent aac93f6 commit d488ca2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions htdocs/emailcollector/class/emailcollector.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);


Expand All @@ -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
}
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit d488ca2

Please sign in to comment.