diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-11 01:25:25 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-11 01:25:25 +0800 |
commit | e2b3b3e420075b9b0e61c01eac86b98810976c69 (patch) | |
tree | 4b80365cd235e1cb1e4c1d41e0b938d81a8cab35 | |
parent | 3d69aee94aee5760c42e23dfbdc9f460fff6c4f0 (diff) | |
download | pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.tar pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.tar.gz pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.tar.bz2 pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.tar.lz pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.tar.xz pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.tar.zst pttbbs-e2b3b3e420075b9b0e61c01eac86b98810976c69.zip |
fix bug
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2822 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | util/waterball.pl | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/util/waterball.pl b/util/waterball.pl index a003d1c6..5a97de76 100644 --- a/util/waterball.pl +++ b/util/waterball.pl @@ -5,18 +5,21 @@ use Time::Local; use LocalVars; use Mail::Sender; use IO::All; +use strict; +my(%water); sub main { + my($fndes, $userid, $mailto, $outmode, $fnsrc); + chdir($BBSHOME); foreach $fndes ( <$JOBSPOOL/water.des.*> ){ ($userid, $mailto, $outmode, $fnsrc) = parsedes($fndes); - next if( !userid || $mailto !~ /\@/ || !-e $fnsrc ); + next if( !$userid || !-e $fnsrc ); - print "($userid, $mailto, $outmode, $fnsrc)\n"; + $mailto = "$userid.bbs\@$MYHOSTNAME" if( $mailto eq '.'); undef %water; process($fnsrc, "$TMP/water/", $outmode, $userid); - output($mailto eq '.' ? "$userid.bbs\@$MYHOSTNAME" : $mailto, - $mailto eq '.' || $mailto =~ /\.bbs/); + output("$userid.bbs\@$MYHOSTNAME", $mailto, $mailto =~ /\.bbs/); unlink($fndes, $fnsrc); } } @@ -32,9 +35,10 @@ sub parsedes($) sub process($$$$) { my($fn, $outdir, $outmode, $me) = @_; + my($cmode, $who, $time, $say, $orig, %LAST, $len) = (); open DIN, "<$fn"; while( <DIN> ){ - next if( !(($cmode, $who, $time, $say, $orig) = parse($_)) || !who ); + next if( !(($cmode, $who, $time, $say, $orig) = parse($_)) || !$who ); if( $outmode ){ $water{$who} .= $orig; @@ -82,9 +86,9 @@ sub parse($) sub output { - my($tomail, $bbsmail) = @_; + my($from, $tomail, $bbsmail) = @_; my $ms = new Mail::Sender{smtp => $SMTPSERVER, - from => "$userid.bbs\@$MYHOSTNAME", + from => $from, charset => 'big5'}; foreach( keys %water ){ |