fixed the date format to match UW-IMAP logs and also add POP3 login accounting

This commit is contained in:
Jordi Sanfeliu 2013-12-23 15:01:26 +01:00
parent 5c21ceb612
commit 9353c9d2fd
1 changed files with 4 additions and 1 deletions

View File

@ -195,7 +195,7 @@ sub serv_update {
if(-r $config->{imap_log}) {
$config->{imap_log_date_format} = $config->{imap_log_date_format} || "%b %d";
my $date_dovecot = strftime($config->{imap_log_date_format}, localtime);
my $date_uw = strftime("%b %e %T", localtime);
my $date_uw = strftime("%b %e", localtime);
open(IN, "$config->{imap_log}");
while(<IN>) {
# UW-IMAP log
@ -203,6 +203,9 @@ sub serv_update {
if(/ imapd\[/ && / Login user=/) {
$imap++;
}
if(/ ipop3d\[/ && / Login user=/) {
$pop3++;
}
}
# Dovecot log
if(/$date_dovecot /) {