summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-04-12 10:46:47 +0000
committerfukachan <fukachan>2001-04-12 10:46:47 +0000
commit2febb5eda706271f0b242f2f8d3ad8a75b36e4bc (patch)
tree92821bfb616bf1e075aa5cd3dceec66a4fc922d7
parent05ba8a36b093930a97cba086b8bdb7f1dba0bf1b (diff)
downloadfml8-2febb5eda706271f0b242f2f8d3ad8a75b36e4bc.tar.gz
fml8-2febb5eda706271f0b242f2f8d3ad8a75b36e4bc.tar.bz2
fml8-2febb5eda706271f0b242f2f8d3ad8a75b36e4bc.zip
debug on when environment variable $debug is defined
-rw-r--r--fml/lib/Mail/Bounce.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/fml/lib/Mail/Bounce.pm b/fml/lib/Mail/Bounce.pm
index bc2a0277..3c5eb51e 100644
--- a/fml/lib/Mail/Bounce.pm
+++ b/fml/lib/Mail/Bounce.pm
@@ -4,7 +4,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.pm,v 1.3 2001/04/11 15:15:55 fukachan Exp $
+# $FML: Bounce.pm,v 1.4 2001/04/11 16:36:45 fukachan Exp $
#
package Mail::Bounce;
@@ -12,6 +12,8 @@ use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD);
use Carp;
+my $debug = $ENV{'debug'} ? 1 : 0;
+
=head1 NAME
Mail::Bounce - analye error messages
@@ -41,6 +43,13 @@ sub analyze
my ($self, $msg) = @_;
my $result = {};
+ if ($debug) {
+ my $h = $msg->get_data_type_list;
+ print " ----- dump msg -----\n";
+ for (@$h) { print " ", $_, "\n";}
+ print " ----- dump msg end -----\n";
+ }
+
for my $pkg (
'DSN',
'Postfix19991231',
@@ -50,6 +59,9 @@ sub analyze
'SimpleMatch',
) {
my $module = "Mail::Bounce::$pkg";
+
+ print "\n --- module: $module\n" if $debug;
+
eval qq {
require $module; $module->import();
$module->analyze( \$msg , \$result );