# Joe R. Jah # August 13 2003 # # Based on Jeff Mann's email to majordomo-users@greatcircle.com # on Sun, 27 Jul 2003. # # Majordomo 1.94.5 usually responds to unrecognized commands with a # message containing the original text plus after each line it adds a # "**** Command not recognized." line and an entire help message. # Since much SPAM is sent with invalid return addresses, they bounce # to Majordomo-Owner;( # This patch for Majordomo 1.94.5 causes it not reply to unrecognized # commands. If any line of the SPAM happen to start with a recognized # command, (help, get, index,...,) Majordomo would respond;( # # To apply the patch: # # - Save the patch to a file on your Majordomo server. # - Login as Majordomo user, (e.g. majordom.) # - In Majordomo home run the following command: # # patch < /path/to/noCommand_noBounce.0 # *** majordomo.orig Thu Jan 13 09:29:31 2000 --- majordomo Wed Aug 13 23:43:47 2003 *************** *** 156,162 **** print STDERR "$0: opening sendmail process.\n" if $DEBUG; # Open the sendmail process to send the results back to the requestor ! &sendmail(REPLY, $reply_to, "Majordomo results$sub_addin"); select((select(REPLY), $| = 1)[0]); --- 156,162 ---- print STDERR "$0: opening sendmail process.\n" if $DEBUG; # Open the sendmail process to send the results back to the requestor ! $reply_pid = &sendmail(REPLY, $reply_to, "Majordomo results$sub_addin"); select((select(REPLY), $| = 1)[0]); *************** *** 192,198 **** # the "do_*" routines implement specific Majordomo commands. # they are all passed the same arguments: @parts. $count++; # assume it's a valid command, so count it. ! if ($cmd eq "end") { print REPLY "END OF COMMANDS\n"; last; } elsif ($cmd =~ /^-/ && (!defined($hdrs{'content-type'}) || $hdrs{'content-type'} !~ /multipart/i)) --- 192,198 ---- # the "do_*" routines implement specific Majordomo commands. # they are all passed the same arguments: @parts. $count++; # assume it's a valid command, so count it. ! if ($cmd eq "end") { print REPLY "END OF COMMANDS\n"; $count--; last; } elsif ($cmd =~ /^-/ && (!defined($hdrs{'content-type'}) || $hdrs{'content-type'} !~ /multipart/i)) *************** *** 204,209 **** --- 204,210 ---- # Content-Type: we trap messages with Content-Type: text/plain, # which is pretty common these days. print REPLY "END OF COMMANDS\n"; + $count--; # it wasn't really a command last; } elsif ($cmd eq "subscribe") { &do_subscribe(@parts); } *************** *** 228,234 **** elsif ($cmd eq "index") { &do_index(@parts); } elsif ($cmd eq "auth") { &do_auth(@parts); } else { ! &squawk("Command '$cmd' not recognized."); $count--; # if we get to here, it wasn't really a command } } --- 229,235 ---- elsif ($cmd eq "index") { &do_index(@parts); } elsif ($cmd eq "auth") { &do_auth(@parts); } else { ! # &squawk("Command '$cmd' not recognized."); $count--; # if we get to here, it wasn't really a command } } *************** *** 1749,1754 **** --- 1750,1757 ---- sub done { # append help, if needed. if ($count == 0) { + kill 9, $reply_pid; + exit(0); print REPLY "**** No valid commands found.\n"; print REPLY "**** Commands must be in message BODY, not in HEADER.\n\n"; } *** majordomo.pl.orig Fri Jan 7 04:32:04 2000 --- majordomo.pl Wed Aug 13 23:40:05 2003 *************** *** 458,464 **** "; ! return; } # check the password for a list --- 458,464 ---- "; ! return $isParent; } # check the password for a list