Changeset 631


Ignore:
Timestamp:
Oct 19, 2011, 12:04:27 AM (9 years ago)
Author:
ben
Message:

adding message status and cleaning unused vitrual, see #28

File:
1 edited

Legend:

Unmodified
Added
Removed
  • postfix-logtools/poststat/poststat

    r630 r631  
    5858  me_sender_no_dns   => 0,
    5959  me_sender_not_fqdn => 0,
     60  mi_bounced         => 0,
    6061  mi_count           => 0,
    6162  mi_deliver         => 0,
    6263  mi_ham             => 0,
     64  mi_inbox           => 0,
     65  mi_robot           => 0,
    6366  mi_size            => 0,
    6467  mi_spam            => 0,
     68  mi_tot             => 0,
    6569  mi_unsure          => 0,
    6670  mi_vir_amav        => 0,
    6771  mi_vir_milt        => 0,
    68   mo_delivered       => 0,
    69   me_no_target       => 0,
     72  mo_bounced         => 0,
     73  mo_deferred        => 0,
     74  mo_sent            => 0,
    7075);
    7176my @backupmx;
     
    171176  }
    172177
    173   # FIXME Did never match in tests
    174   if ($prog eq 'virtual') {
    175     # Messages delivery (output and errors)
    176     # FIXME Did never match in tests
    177     # maybe try to match
    178     # /status=sent (250 2.0.0 Ok/ for transfered mails
    179     # but this one seems to match a lot of transfers
    180     # or
    181     # /status=sent (delivered via dovecot service)/ for local delivery
    182     $stat{mo_delivered}++,       next if /delivered to maildir/;
    183     # FIXME Did never match in tests
    184     $stat{me_no_target}++,       next if /unknown user:/;
    185   }
    186 
    187   #print "$prog | $_";
     178  if ($prog eq 'pipe') {
     179    $stat{mi_inbox}++,           next if / status=sent \(delivered via dovecot service\)/;
     180    $stat{mi_bounced}++,         next if / status=bounced /;
     181   
     182    next;
     183  }
     184
     185  if ($prog eq 'local') {
     186    $stat{mi_robot}++,           next if / status=sent \(delivered to command/;
     187   
     188    next;
     189  }
     190
     191  if ($prog eq 'smtp') {
     192    $stat{mo_sent}++,            next if / status=sent /;
     193    $stat{mo_bounced}++,         next if / status=bounced /;
     194    $stat{mo_deferred}++,        next if / status=deferred /;
     195
     196  }
    188197}
    189198
     
    195204$stat{ci_connect_tot}     = $stat{ci_connect_ext_tot} + $stat{ci_connect_int_tot};
    196205
     206$stat{mi_tot} = $stat{mi_inbox} + $stat{mi_robot} + $stat{mi_bounced} + $stat{mo_sent} + $stat{mo_bounced};
     207
    197208printf("%-20s: %u\n", $_, $stat{$_}) foreach sort keys %stat;
    198209
Note: See TracChangeset for help on using the changeset viewer.