mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Merge pull request #32456 from Hystepik/fix-email-collector
Fix email collector datetimelast ok and email fetching
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user