added support for postfix-policyd-spf-perl SPF handler in Mail graph

This commit is contained in:
Jordi Sanfeliu 2015-05-05 16:55:51 +02:00
parent 84a81c7a5b
commit a0ec8d2f80
1 changed files with 42 additions and 25 deletions

View File

@ -355,33 +355,50 @@ sub mail_update {
}
while(<IN>) {
my @line;
if(/^$date/ && /MailScanner/ && /Spam Checks:/ && /Found/ && /spam messages/) {
if(/^$date/) {
if(/MailScanner/ && /Spam Checks:/ && /Found/ && /spam messages/) {
@line = split(' ', $_);
$spam += int($line[8]);
}
if(/^$date/ && /MailScanner/ && /Virus Scanning:/ && /Found/ && /viruses/) {
if(/MailScanner/ && /Virus Scanning:/ && /Found/ && /viruses/) {
@line = split(' ', $_);
$virus += int($line[8]);
}
if(/^$date/ && /amavis\[.* SPAM/) {
if(/amavis\[.* SPAM/) {
$spam++;
}
if(/^$date/ && /amavis\[.* INFECTED|amavis\[.* BANNED/) {
if(/amavis\[.* INFECTED|amavis\[.* BANNED/) {
$virus++;
}
if(/^$date/ && / SPF none/) {
$spf_none++;
}
if(/^$date/ && / SPF pass/) {
# postfix-policyd-spf-perl
if (/policy-spf/) {
if(/: pass/) {
$spf_pass++;
}
if(/^$date/ && / SPF softfail/) {
} elsif(/: none/) {
$spf_none++;
} elsif(/ action=550 /) {
$spf_fail++;
} else {
# There one line per spf check, so it gets here, we'll consider it is a softfail
$spf_softfail++;
}
if(/^$date/ && / SPF fail/) {
# for other SPF handlers (smf-spf)
} else {
if(/ SPF none/) {
$spf_none++;
}
if(/ SPF pass/) {
$spf_pass++;
}
if(/ SPF softfail/) {
$spf_softfail++;
}
if(/ SPF fail/) {
$spf_fail++;
}
}
}
}
close(IN);
}