summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-04-10 11:54:22 +0000
committerfukachan <fukachan>2001-04-10 11:54:22 +0000
commitb7c500e850c3a44f0e4e4faf8ac0ac2a0fbdc621 (patch)
treeacabef9722f4e682859ca0fd466aa437ab1dfa75
parent2a9614c08c03fea937d2776e4194c4fb11948286 (diff)
downloadfml8-b7c500e850c3a44f0e4e4faf8ac0ac2a0fbdc621.tar.gz
fml8-b7c500e850c3a44f0e4e4faf8ac0ac2a0fbdc621.tar.bz2
fml8-b7c500e850c3a44f0e4e4faf8ac0ac2a0fbdc621.zip
modified to use Mail::Bounce. more OO way
-rwxr-xr-xregress/message/bounce.pl26
1 files changed, 16 insertions, 10 deletions
diff --git a/regress/message/bounce.pl b/regress/message/bounce.pl
index 7b60a2ae..0f56c264 100755
--- a/regress/message/bounce.pl
+++ b/regress/message/bounce.pl
@@ -5,7 +5,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: bounce.pl,v 1.1 2001/04/09 15:33:30 fukachan Exp $
+# $FML: bounce.pl,v 1.2 2001/04/09 15:56:53 fukachan Exp $
#
use strict;
@@ -14,20 +14,26 @@ use lib qw(../../cpan/lib);
use Mail::Message;
for my $f (@ARGV) {
+ print "// check $f\n";
my $fh = new FileHandle $f;
my $msg = Mail::Message->parse( { fd => $fh } );
my $r = {};
- for my $pkg ('DSN', 'Postfix19991231', 'Qmail') {
- print "--- $pkg\n";
- eval qq {
- require Mail::Bounce::$pkg;
- \$r = Mail::Bounce::$pkg->analyze( \$msg );
- };
- print $@ if $@;
+ use Mail::Bounce;
+ my $bouncer = new Mail::Bounce;
+ $bouncer->analyze( $msg );
- eval q{ use Data::Dumper; print Dumper( $r );};
- print $@ if $@;
+ for my $a ( $bouncer->address_list ) {
+ print "address: $a\n";
+
+ print " status: ";
+ print $bouncer->status( $a );
+ print "\n";
+
+ print " reason: ";
+ print $bouncer->reason( $a );
+ print "\n";
+ print "\n";
}
}