1c1 < #!/bin/perl --- > #!/usr/bin/perl 25a26 > $max_unrecognized = 10; 172c173,174 < &sendmail(REPLY, $reply_to, "Majordomo results$sub_addin"); --- > open(REPLY, ">/tmp/majordomo.$$"); > # &sendmail(REPLY, $reply_to, "Majordomo results$sub_addin"); 178a181 > $unrecog = 0; 245a249,252 > $unrecog++; > } > if(!$count && $unrecog > $max_unrecognized ) { # probably a spam, abort > last; 1765c1772,1773 < if ($needs_help || ($count == 0)) { --- > if (($needs_help || ($count == 0)) > && $unrecog < $max_unrecognized ) { 1770c1778 < # close (and thereby send) the reply --- > # close the reply (in a temp file) 1771a1780,1806 > if($unrecog < $max_unrecognized && $count) { > # the number of errors is low and has at least one valid command > # so this is probably a valid majordomo request. Send our response > # from the temp file previously written. > open(RESULTS, " &sendmail(REPLY, $reply_to, "Majordomo results$sub_addin"); > while() { > print REPLY $_; > } > close(RESULTS); > close(REPLY); > } > else { > # lots of errors, most likely from a spam. Don't reply to the "sender" > # who is probably a spammer. Instead, just send a note to the owner > # that we killed the reply, and who the "recipient" would have been. > &sendmail(REPLY, "majordomo-owner\@$whereami", "Majordomo results$sub_addin"); > print REPLY < majordomo message shunted to majordomo-owner due to excessive errors ($unrecog) > > The recipient would have been: $reply_to > > (signed) majordomo\@$whereami > EOM > close(REPLY); > } > unlink("/tmp/majordomo.$$");