#!/usr/bin/perl -wT
use strict;
use Mail::Audit;

# Allow reading from file instead of stdin, shouldn't this be automatic???
if ($ARGV[0]) {
    -f $ARGV[0] || die "File $ARGV[0] doesn't exist.\n";
    close(STDIN);
    open(STDIN,$ARGV[0]);
}
my $mail = Mail::Audit->new;

unless ($mail->get('Received')) {
    exit 1;
}

print $mail->header;
