From 28cf7e030d92fda176fc7a03d420d2336a478932 Mon Sep 17 00:00:00 2001 From: fukachan Date: Mon, 12 Feb 2001 15:50:40 +0000 Subject: log smtp transaction at _smtplog --- fml/lib/FML/Process/Distribute.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'fml/lib/FML/Process') diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 848fe577..5b06b50e 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -202,6 +202,24 @@ sub _deliver_article my $fp = sub { Log(@_);}; # pointer to the log function my $sfp = sub { my ($s) = @_; print $s; print "\n" if $s !~ /\n$/o;}; + + { # debug + my $dir = $config->{ smtp_log_dir }; + use FML::Utils qw(mkdirhier); + mkdirhier($dir) unless -d $dir; + + my $f = $config->{ smtp_log_file }; + unlink $f if -f $f; + if ($f) { + use FileHandle; + my $fh = new FileHandle "> $f"; + if (defined $fh) { + $fh->autoflush(1); + $sfp = sub { print $fh @_;}; + } + } + } + my $service = new MailingList::Delivery { log_function => $fp, smtp_log_function => $sfp, -- cgit v1.2.1