#!/usr/bin/perl
$l=@ARGV[0];
$LOGFILE="/var/log/syslog";
open(file,$LOGFILE) || die "Bye bye";
while(<file>)
{
         if(/$l/ )
         { $i=1;
           if(/mail.info\] ([^\:]*)/) {
           $out = "$out $1"; };
         }
}
close(file);
open(file,$LOGFILE) || die "Bye bye";
while(<file>)
{
        /mail.info\] ([^\:]*)/;
        $match=$1;
        if($out=~/$match/ && /from/)
        {
         /([A-z]{3}?\ [0-9]*\ ([0-9](.)*?){3}?) /;
         print "$1 ";
       if( /from=([^,]*)/) {
        print "$1"; };
        print "\n";
        }
}


