Skip to content
Snippets Groups Projects
Commit 7cb48fc4 authored by Peter Rotich's avatar Peter Rotich
Browse files

Log warning on excessive errors

parent cfc29e6e
Branches
Tags
No related merge requests found
...@@ -478,15 +478,26 @@ class MailFetcher { ...@@ -478,15 +478,26 @@ class MailFetcher {
$errors++; $errors++;
} }
if(($max && $msgs>=$max) || $errors>100) if($max && ($msgs>=$max || $errors>($max*0.8)))
break; break;
} }
//Warn on excessive errors
if($errors>$msgs) {
$warn=sprintf('Excessive errors processing emails for %s/%s. Please manually check the inbox.',
$this->getHost(), $this->getUsername());
$this->log($warn);
}
@imap_expunge($this->mbox); @imap_expunge($this->mbox);
return $msgs; return $msgs;
} }
function log($error) {
global $ost;
$ost->logWarning('Mail Fetcher', $error);
}
/* /*
MailFetcher::run() MailFetcher::run()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment