-------- Original Message --------
Subject: Re: Postfix log analizer
Date: Tue, 01 Apr 2003 16:40:32 +0100
From: mimo <[EMAIL PROTECTED]>
To: Teun Vink <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Here is my lsmail script - usage:
lsmail <regex> [optional: log file extension, .1,.2, etc]
ex: lsmail "from=<mimo" ".1"
looks for all email I have sent yesterday
mm
#!/usr/bin/perl
#03 mimo / GN
my ($pattern,$ext) = @ARGV;
$maillog="/var/log/maillog".$ext;
#$pattern="$ARGV[0]";
print("$pattern");
open(INFILE,$maillog);
@lines;
$linecount=0;
while(<INFILE>) {
$line = $_;
if(m/$pattern/) {
# print "$line \n";
@fields = split(/\s+/, $line);
# print "@fields\n";
# print "@fields[5]\n";
if($fields[5] =~ /(\d+)/) {
# print("$fields[5]\n");
$lines[$linecount++]=$fields[5];
}
}
}
foreach $i (@lines) {
system("grep $i $maillog");
}Teun Vink wrote:
On Wed, 2003-04-02 at 14:53, Andre Luis Lopes wrote: [..]
Actually, I'm already using pflogsum but it doesn't seems to support generating the kind of report I'm looking for. It's good enough for generating statistics about a lot of useful data, but what I would like to see in a report is something like :
Message ID Sender Recipient Size XXXXX [EMAIL PROTECTED] [EMAIL PROTECTED] XXX
This shouldn't be too hard to do with some grepping/regexp'ing on mailserver logs, now should it?
The size is not that important.
Who made you believe that? ;-)
Teun
-- BOFH excuse #103: operators on strike due to broken coffee machine
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

