Changeset 626


Ignore:
Timestamp:
Oct 18, 2011, 3:19:55 PM (9 years ago)
Author:
ben
Message:

spam/unsure infos/option, see #28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postfix-logtools/poststat/poststat

    r625 r626  
    5353  me_sender_not_fqdn => 0,
    5454  mi_count           => 0,
     55  mi_deliver         => 0,
     56  mi_ham             => 0,
    5557  mi_size            => 0,
     58  mi_spam            => 0,
     59  mi_unsure          => 0,
    5660  mo_delivered       => 0,
    5761  me_no_target       => 0,
     
    5963my @backupmx;
    6064my @lanservers;
     65my @spamdir;
     66my @unsuredir;
    6167GetOptions(
    62   "backup-mx=s{,}" => \@backupmx,
    63   "lan-servers=s{,}" => \@lanservers
     68  "backup-mx=s{,}"   => \@backupmx,
     69  "lan-servers=s{,}" => \@lanservers,
     70  "spam-dir=s{,}"    => \@spamdir,
     71  "unsure-dir=s{,}"  => \@unsuredir
    6472);
    6573
     
    7078  $stat{grey_autowl}++,         next if /.* milter-greylist: .* autowhitelisted for another/;
    7179  $stat{grey_hard_wl}++,        next if /.* milter-greylist: .* skipping greylist because.*is whitelisted/;
     80
     81  # spam
     82  if (@spamdir) {
     83      foreach my $spam (@spamdir) {
     84          $stat{mi_spam}++,     next if /deliver\(.* mail .*$spam/;
     85      }
     86  }
     87  if (@unsuredir) {
     88      foreach my $unsure (@unsuredir) {
     89           $stat{mi_unsure}++,  next if /deliver\(.* mail .*$unsure/;
     90      }
     91  }
     92  $stat{mi_deliver}++,               next if /deliver\(.* mail /;
    7293
    7394  next if !s/.* postfix\/(.*?)\[\d+\]: //;
     
    149170$stat{ce_ok} += $stat{$_} foreach grep {/^ce_/} keys %stat;
    150171
     172$stat{mi_ham} = $stat{mi_deliver} - $stat{mi_spam} - $stat{mi_unsure};
     173
    151174printf("%-20s: %u\n", $_, $stat{$_}) foreach sort keys %stat;
    152175
Note: See TracChangeset for help on using the changeset viewer.