Merge pull request #32456 from Hystepik/fix-email-collector

Fix email collector datetimelast ok and email fetching
This commit is contained in:
Laurent Destailleur
2025-02-22 17:32:05 +01:00
committed by GitHub

View File

@@ -1165,6 +1165,7 @@ class EmailCollector extends CommonObject
$arrayofemail = array();
$now = dol_now();
$datelastok = $now;
if (empty($this->host)) {
$this->error = $langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('EMailHost'));
@@ -3642,6 +3643,7 @@ class EmailCollector extends CommonObject
// Stop the loop to process email if we reach maximum collected per collect
if ($this->maxemailpercollect > 0 && $nbemailok >= $this->maxemailpercollect) {
dol_syslog("EmailCollect::doCollectOneCollector We reach maximum of ".$nbemailok." collected with success, so we stop this collector now.");
$datelastok = strtotime($headers['Date']); // Set datetime
break;
}
} else {
@@ -3743,7 +3745,7 @@ class EmailCollector extends CommonObject
}
if (empty($error) && empty($mode)) {
$this->datelastok = $now;
$this->datelastok = $datelastok;
}
if (!empty($this->errors)) {