Yesterday I tried to use approve to forward a message that got caught by the
admin filter, but was actually a valid message. It doesn't work. There's
some strange return syntax that causes the subroutine to return before doing
any useful work! Once I got pas that, I found a number of smaller problems.
There are *two* \n after the Approved line, which forwards the headers with
the mail message! How embarassing. My /bin/mail program doesn't take -s,
so I removed it. Also, I named mail /bin/mail to make it clearer. Finally,
I added a confirmation message so it wouldn't silently exit, making me wonder
if I was using the broken version.
Now it actually works.
*** /local/majordomo-1.90/bin/approve Tue May 17 11:46:20 1994
--- bin/approve Mon Jun 27 11:14:15 1994
***************
*** 151,158 ****
print MAIL "-" x 20, "\n";
print MAIL "To: $reply_to\n\n";
} else {
! open(MAIL, "|mail -s \"\" $reply_to") ||
! die ("open(\"|mail ...\"): $!");
}
print MAIL "approve $passwd $_";
close(MAIL);
--- 151,158 ----
print MAIL "-" x 20, "\n";
print MAIL "To: $reply_to\n\n";
} else {
! open(MAIL, "|/bin/mail $reply_to") ||
! die ("open(\"|/bin/mail ...\"): $!");
}
print MAIL "approve $passwd $_";
close(MAIL);
***************
*** 184,192 ****
}
}
! warn "Can't find password for list $list, Stopped" , return
! if !defined($passwd{$list});
if (defined($opt_d)) {
open(MAIL, ">&STDOUT");
--- 184,195 ----
}
}
+ $list =~ s/@.*//;
! if (!defined($passwd{$list})) {
! warn "Can't find password for list $list, Stopped";
! return;
! }
if (defined($opt_d)) {
open(MAIL, ">&STDOUT");
***************
*** 193,202 ****
print MAIL "-" x 20, "\n";
print MAIL "To: $post_to\n\n";
} else {
! open(MAIL, "|mail -s \"\" $post_to") || die("open(\"|mail ...\"): $!");
}
! print MAIL "Approved: $passwd{$list}\n\n";
while (<$FILE>) {
if (/^>?From / && ! defined($from_skipped)) {
--- 196,205 ----
print MAIL "-" x 20, "\n";
print MAIL "To: $post_to\n\n";
} else {
! open(MAIL, "|/bin/mail $post_to") || die("open(\"|/bin/mail...\"): $!");
}
! print MAIL "Approved: $passwd{$list}\n";
while (<$FILE>) {
if (/^>?From / && ! defined($from_skipped)) {
***************
*** 207,212 ****
--- 210,216 ----
print MAIL $_;
}
close(MAIL);
+ print STDERR "Mailed approved message to $list list.\n";
}
sub read_config {
--
Paul Close pdc@sgi.com ...!{ames, decwrl, uunet}!sgi!pdc
No fate but what we make
|
|