mirror of
https://github.com/Froxlor/Froxlor.git
synced 2024-09-22 02:47:34 +00:00
fixed parsing due to changes in dovecots default mail_log_prefix
regex supports old and new default format now (see https://wiki2.dovecot.org/Upgrading/2.3)
This commit is contained in:
parent
489ccbe07a
commit
4745581720
@ -209,12 +209,12 @@ class MailLogParser
|
||||
|
||||
$timestamp = $this->getLogTimestamp($line);
|
||||
if ($this->startTime < $timestamp) {
|
||||
if (preg_match("/dovecot.*(?::|\]) imap\(.*@([a-z0-9\.\-]+)\):.*(?:in=(\d+) out=(\d+)|bytes=(\d+)\/(\d+))/i", $line, $matches)) {
|
||||
if (preg_match("/dovecot.*(?::|\]) imap\(.*@([a-z0-9\.\-]+)\)(<\d+><[a-z0-9+\/=]+>)?:.*(?:in=(\d+) out=(\d+)|bytes=(\d+)\/(\d+))/i", $line, $matches)) {
|
||||
// Dovecot IMAP
|
||||
$this->addDomainTraffic($matches[1], (int) $matches[2] + (int) $matches[3], $timestamp);
|
||||
} elseif (preg_match("/dovecot.*(?::|\]) pop3\(.*@([a-z0-9\.\-]+)\):.*in=(\d+).*out=(\d+)/i", $line, $matches)) {
|
||||
$this->addDomainTraffic($matches[1], (int) $matches[3] + (int) $matches[4], $timestamp);
|
||||
} elseif (preg_match("/dovecot.*(?::|\]) pop3\(.*@([a-z0-9\.\-]+)\)(<\d+><[a-z0-9+\/=]+>)?:.*in=(\d+).*out=(\d+)/i", $line, $matches)) {
|
||||
// Dovecot POP3
|
||||
$this->addDomainTraffic($matches[1], (int) $matches[2] + (int) $matches[3], $timestamp);
|
||||
$this->addDomainTraffic($matches[1], (int) $matches[3] + (int) $matches[4], $timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user