On Tue, Dec 25, Landy Roman wrote:
i know there is a utility or command that makes a copy of the procmail log and clears the file and tells you how many email were process ... i forgot the command :-)
Erm, wish I had known of such a thing.... In the meantime, I wrote the following for myself, so that I could see what the heck was going on (which lists/mailboxes were getting mail stuffed into them). Adjust as needed. Color highlights and all... ------------------------------------------------------- #!/usr/local/bin/perl -w use strict; my $FETCHMAIL = "fetchmail"; my $PROCMAILLOG = "/home/me/Mail/procmail.log"; open LOG, $PROCMAILLOG or die "Couldn't open O_READ $PROCMAILLOG: $!\n"; seek LOG, 0, 2; my @foutput = qx|$FETCHMAIL|; print for @foutput; print "-" x 64, "\n"; sleep 1; my %newmail; while ( <LOG> ) { next if /Subject:/; my ( $dir ) = m|Folder\:.+/([a-zA-Z_-]+)|; next unless defined $dir; $newmail{$dir}++; } for ( keys %newmail ) { print "\033[0;31m$newmail{$_}\033[0m message", $newmail{$_} > 1 ? "s" : " ", " in\033[0;36m [ $_ ]\033[0m\n"; } ------------------------------------------------------- if you _really_ want to hose the procmail.log file afterwards, add qx|echo "" > $PROCMAILLOG|; to the end of the scriptlet. But then, you lose some information to help you debug stuff, should you need to debug.... Cheers. Michael -- Michael Fischer 7.5 million years to run michael@visv.net printf "%d", 0x2a; -- deep thought