#!/usr/local/bin/perl -w # Opens a single mail file and locates the first reason for a bounce # K. P. Inscoe (kinscoe@inscoe.org) - October 10, 2002 # Revision history # # K. P. Inscoe 1.0 - October 10, 2002 Create original. # K. P. Inscoe 1.1 - January 7, 2003 Added support for ESMTP diagnostics open(IN, "<$ARGV[0]") or die "cannot open $ARGV[0] for writing - $!\n"; do { $line = } until ( $line =~ m/had permanent fatal errors/ ) || eof; print "------------------------------\n\nemail address: "; do { $line = ; print $line } until ( $line =~ m/Message will be deleted/ || $line =~ m/Last-Attempt-Date:/ ) || eof; close(IN);