Hi Guys,

The code below extracts an ip address from the /var/log/maillog file in the
event of the line containing the words "reject=550". It works fine, but is
there a way of shortening that regular expression?

open(LOG,"/var/log/maillog");

        while(<LOG>) {
                chomp;
                if($_ =~ /reject=550/) {

                if($_ =~ /\[(\d+\.\d+\.\d+\.\d+)\]/) {
                $address = $1;

# Add address to firewall filtering here
                   }

        }

}
close(LOG);


Thanks

Rob


-- 
Email Disclaimer can be viewed at: 
http://www.netscalibur.co.uk/email.html 
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to