From: WebSTUMP Date: Wed, 2 Feb 2011 18:33:44 +0000 (+0000) Subject: fix noack function: store whole From line contents (not just the email address) in... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=commitdiff_plain;h=5fea745a1058e210705d1f1ee4b29e342ce2b8fc;p=modbot-mtm.git fix noack function: store whole From line contents (not just the email address) in the noack list, and when matching look only for the contents (not also the header name From:) --- diff --git a/stump/bin/processNoack.pl b/stump/bin/processNoack.pl index 521e36f..ab468d2 100755 --- a/stump/bin/processNoack.pl +++ b/stump/bin/processNoack.pl @@ -20,9 +20,8 @@ while( ) { } $From =~ s/^From: //; -if( $From =~ m/([\w-\.]*)\@([\w-\.]+)/ ) { - $From = "$1\@$2"; -} else { +chomp $From; +if( $From !~ m/([\w-\.]*)\@([\w-\.]+)/ || $From =~ m/\n/) { print STDERR "From line `$From' is incorrect\n"; exit 0; } diff --git a/stump/bin/submission.pl b/stump/bin/submission.pl index f319617..e49680f 100755 --- a/stump/bin/submission.pl +++ b/stump/bin/submission.pl @@ -133,7 +133,10 @@ print STDERR "Too many newsgroups\n"; # checks if poster needs acknowledgment of receipt # sub checkAck { - if( &nameIsInListExactly( $From, "noack.list" ) ) { + my $fromaddr = $From; + $fromaddr =~ s/^[-A-Za-z]+\s*\:\s*//; + print STDERR "checking noack.list for \"$From|$fromaddr\"\n"; + if( &nameIsInListExactly( $fromaddr, "noack.list" ) ) { $needAck = "no"; } else { $needAck = "yes";