[ Chan Wilson writes: ]
> After talking with John Rouillard at SAGE '95 last week about the
> seeming lack of progress with Majordomo 2.0, and general mismash of
> patches, fixes, and features that are propogating, he graciously
> accepted my volunteering to coordinate such efforts.
>
> To that end, I hereby solicit all patches, bug fixes, and features
> that have been done or are being contemplated. Please send them to
> majordomo-workers@greatcircle.com, so others can kibitz and
> brainstorm.
Great! In the meantime, here are my changes to 1.93. I haven't looked
with all the files in the contrib directory and such. You also might
want to note my ownership and permissions setup I copied to mj-workers
earlier.
Things fixed with these patches:
* Escape quoted '@' characters for Perl 5.
* Remove absolute path references to sendmail except in configuration
file.
* Preserve ownership and permissions when a new file is created as a
result of editing a file. This includes not arbitrarily setting the
umask in the config file but reserving that for list.config updates.
* Rearrange sequence of how comments are stripped from addresses for
embedded '#' characters.
* Fix void join in RetMailAddr.
* Miscellaneous fixes and general cleanup of cruft.
Index: approve
===================================================================
RCS file: /cvs/tools/PD/majordomo/approve,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 approve
*** 1.1.1.1 1995/03/01 14:43:23
--- approve 1995/04/14 21:01:15
***************
*** 135,147 ****
if ((/^\tsubscribe\s/) || (/^\tunsubscribe\s/)) {
if (!defined($reply_to)) {
warn("No \"Reply-To:\"; exiting");
! exit(1);;
}
s/^\t//;
split;
$list = $_[1];
$list =~ tr/A-Z/a-z/;
! $passwd = $passwd{"$list@$reply_to"};
if (! $passwd) {
warn("no password for list $list; skipping \"$_\"");
next;
--- 135,147 ----
if ((/^\tsubscribe\s/) || (/^\tunsubscribe\s/)) {
if (!defined($reply_to)) {
warn("No \"Reply-To:\"; exiting");
! exit(1);
}
s/^\t//;
split;
$list = $_[1];
$list =~ tr/A-Z/a-z/;
! $passwd = $passwd{"$list\@$reply_to"};
if (! $passwd) {
warn("no password for list $list; skipping \"$_\"");
next;
***************
*** 151,157 ****
print MAIL "-" x 20, "\n";
print MAIL "To: $reply_to\n\n";
} else {
! open(MAIL, "| /usr/ucb/mail -s \"\" $reply_to") ||
die ("open(\"|mail ...\"): $!");
}
print MAIL "approve $passwd $_";
--- 151,157 ----
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 $_";
***************
*** 171,177 ****
if (defined($reply_to)) {
# if there's a "Reply-To:" field set, use it.
$post_to = $reply_to;
! } elsif ($list =~ /@/) {
# if the list name already appears fully qualified, use it
$post_to = $list;
} else {
--- 171,177 ----
if (defined($reply_to)) {
# if there's a "Reply-To:" field set, use it.
$post_to = $reply_to;
! } elsif ($list =~ /\@/) {
# if the list name already appears fully qualified, use it
$post_to = $list;
} else {
***************
*** 180,186 ****
warn("Can't distinguish between multiple lists named '$list'\nSkipping '$file'");
return;
} else {
! $post_to = $list . "@" . $site{$list};
}
}
--- 180,186 ----
warn("Can't distinguish between multiple lists named '$list'\nSkipping '$file'");
return;
} else {
! $post_to = $list . "\@" . $site{$list};
}
}
***************
*** 223,234 ****
$l = $_[0]; $l =~ tr/A-Z/a-z/; # list
$p = $_[1]; # password
$m = $_[2]; $m =~ tr/A-Z/a-z/; # majordomo@site
! split(/@/, $m);
$s = $_[1]; $s =~ tr/A-Z/a-z/; # site
$passwd{$l} = $p;
! $passwd{"$l@$m"} = $p;
! $passwd{"$l@$s"} = $p;
if (defined($site{$l})) {
# if it's already defined, there's more than one list by this name
$site{$l} = "MULTIPLE";
--- 223,234 ----
$l = $_[0]; $l =~ tr/A-Z/a-z/; # list
$p = $_[1]; # password
$m = $_[2]; $m =~ tr/A-Z/a-z/; # majordomo@site
! split(/\@/, $m);
$s = $_[1]; $s =~ tr/A-Z/a-z/; # site
$passwd{$l} = $p;
! $passwd{"$l\@$m"} = $p;
! $passwd{"$l\@$s"} = $p;
if (defined($site{$l})) {
# if it's already defined, there's more than one list by this name
$site{$l} = "MULTIPLE";
Index: bounce
===================================================================
RCS file: /cvs/tools/PD/majordomo/bounce,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 bounce
*** 1.1.1.1 1995/03/01 14:43:23
--- bounce 1995/04/14 20:59:04
***************
*** 54,67 ****
$list = shift(@ARGV);
$list =~ tr/A-Z/a-z/;
! $list =~ s/@.*//;
$list_passwd = $passwd{$list};
if (! $list_passwd) {
die("no password for list $list; stopping");
}
! $bounce_passwd = $passwd{"bounces@$majordomo{$list}"};
if (! $bounce_passwd) {
die("no password for list bounces; stopping");
}
--- 54,67 ----
$list = shift(@ARGV);
$list =~ tr/A-Z/a-z/;
! $list =~ s/\@.*//;
$list_passwd = $passwd{$list};
if (! $list_passwd) {
die("no password for list $list; stopping");
}
! $bounce_passwd = $passwd{"bounces\@$majordomo{$list}"};
if (! $bounce_passwd) {
die("no password for list bounces; stopping");
}
***************
*** 71,78 ****
if (defined($opt_d)) {
open(MSG, ">&STDOUT");
} else {
! open(MSG, "|/usr/lib/sendmail $majordomo{$list}") ||
! die("open(MSG, \"|/usr/lib/sendmail $majordomo{$list}\"): $!\nStopped");
}
print MSG <<EOF;
--- 71,78 ----
if (defined($opt_d)) {
open(MSG, ">&STDOUT");
} else {
! open(MSG, "|mail $majordomo{$list}") ||
! die("open(MSG, \"|mail $majordomo{$list}\"): $!\nStopped");
}
print MSG <<EOF;
***************
*** 99,105 ****
$_[0] =~ tr/A-Z/a-z/;
$_[2] =~ tr/A-Z/a-z/;
$passwd{$_[0]} = $_[1];
! $passwd{"$_[0]@$_[2]"} = $_[1];
$majordomo{$_[0]} = $_[2];
}
close(CONF);
--- 99,105 ----
$_[0] =~ tr/A-Z/a-z/;
$_[2] =~ tr/A-Z/a-z/;
$passwd{$_[0]} = $_[1];
! $passwd{"$_[0]\@$_[2]"} = $_[1];
$majordomo{$_[0]} = $_[2];
}
close(CONF);
Index: bounce-remind
===================================================================
RCS file: /cvs/tools/PD/majordomo/bounce-remind,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 bounce-remind
*** 1.1.1.1 1995/03/01 14:43:23
--- bounce-remind 1995/04/17 13:15:58
***************
*** 33,52 ****
# All these should be in the standard PERL library
unshift(@INC, $homedir);
! open(MSG, "|/usr/lib/sendmail bounces@$whereami") ||
! die("open(MSG, \"|/usr/lib/sendmail bounces@$whereami\"): $!\nStopped");
print MSG <<EOF;
! To: Bounces@$whereami
! From: nobody@$whereami
Subject: Bouncing email from mailing lists at $whereami
Reply-To: $whoami
! Your address has been moved to Bounces@$whereami
from some other mailing list at $whereami
because email to you was bouncing.
! Here are the addresses currently on Bounces@$whereami
so that you can see which of your addresses is among them.
The comment for each address shows the date it was moved,
and the first list it was removed from. If you were on
--- 33,52 ----
# All these should be in the standard PERL library
unshift(@INC, $homedir);
! open(MSG, "|mail bounces\@$whereami") ||
! die("open(MSG, \"|mail bounces\@$whereami\"): $!\nStopped");
print MSG <<EOF;
! To: Bounces\@$whereami
! From: nobody\@$whereami
Subject: Bouncing email from mailing lists at $whereami
Reply-To: $whoami
! Your address has been moved to Bounces\@$whereami
from some other mailing list at $whereami
because email to you was bouncing.
! Here are the addresses currently on Bounces\@$whereami
so that you can see which of your addresses is among them.
The comment for each address shows the date it was moved,
and the first list it was removed from. If you were on
***************
*** 71,77 ****
Bounces and back on to the other list by sending the
following to $whoami:
! subscribe your_list
unsubscribe bounces
To subscribe or unsubscribe an address other than where you're
--- 71,77 ----
Bounces and back on to the other list by sending the
following to $whoami:
! subscribe list_name
unsubscribe bounces
To subscribe or unsubscribe an address other than where you're
Index: config_parse.pl
===================================================================
RCS file: /cvs/tools/PD/majordomo/config_parse.pl,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 config_parse.pl
*** 1.1.1.1 1995/03/01 14:43:23
--- config_parse.pl 1995/04/18 15:17:56
***************
*** 229,235 ****
'sender',
"The envelope and sender address for the
! resent mail. This string has \"@\" and the value
of resend_host appended to it to make a
complete address. For majordomo, it provides the sender address
for the welcome mail message generated as part of the subscribe command.",
--- 229,235 ----
'sender',
"The envelope and sender address for the
! resent mail. This string has \"\@\" and the value
of resend_host appended to it to make a
complete address. For majordomo, it provides the sender address
for the welcome mail message generated as part of the subscribe command.",
***************
*** 447,454 ****
--- 447,456 ----
$key, $op, $value
.
+ local($oldumask) = umask($config_umask);
&main'open_temp(OUT, "$listdir/$list.config.out") ||
&abort("Can't create new config file $listdir/$list.config.out");
+ umask($oldumask);
$installing_defaults = 1;
Index: majordomo
===================================================================
RCS file: /cvs/tools/PD/majordomo/majordomo,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 majordomo
*** 1.1.1.1 1995/03/01 14:43:23
--- majordomo 1995/04/28 13:46:19
***************
*** 18,27 ****
# PATH it is set in the wrapper, so there is no need to set it here.
#$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
- # What shall we use for temporary files?
- $tmp = "/tmp/majordomo.$$";
-
-
# Before doing anything else tell the world I am majordomo
# The mj_ prefix is reserved for tools that are part of majordomo proper.
$main'program_name = 'mj_majordomo';
--- 18,23 ----
***************
*** 135,142 ****
}
print REPLY ">>>> $_"; # echo the line we are processing
$_ = &chop_nl($_); # strip any trailing newline
- s/#.*//g; # strip comments
s/^\s*//g; # strip leading whitespace
s/\s*$//g; # strip trailing whitespace
s/\\ /\001/g; # protected escaped whitepace
@parts = split(" "); # split into component parts
--- 131,138 ----
}
print REPLY ">>>> $_"; # echo the line we are processing
$_ = &chop_nl($_); # strip any trailing newline
s/^\s*//g; # strip leading whitespace
+ s/^#.*//g; # strip comments
s/\s*$//g; # strip trailing whitespace
s/\\ /\001/g; # protected escaped whitepace
@parts = split(" "); # split into component parts
***************
*** 296,305 ****
# requester, so drop them from the list
&lopen(LIST, "", "$listdir/$clean_list") ||
&abort("Can't open $listdir/$clean_list: $!");
open(NEW, ">$listdir/$clean_list.new") ||
&abort("Can't open $listdir/$clean_list.new: $!");
! chmod(0664, "$listdir/$clean_list.new") ||
! &abort("chmod(0664, \"$listdir/$clean_list.new\"): $!");
while (<LIST>) {
if (! &addr_match($subscriber, $_,
(&cf_ck_bool($clean_list,"mungedomain") ? 2 : undef))) {
--- 292,305 ----
# requester, so drop them from the list
&lopen(LIST, "", "$listdir/$clean_list") ||
&abort("Can't open $listdir/$clean_list: $!");
+ (local($mode, $uid, $gid) = (stat(LIST))[2,4,5]) ||
+ &abort("Can't stat listdir/$clean_list: $!");
open(NEW, ">$listdir/$clean_list.new") ||
&abort("Can't open $listdir/$clean_list.new: $!");
! chmod($mode, "$listdir/$clean_list.new") ||
! &abort("chmod($mode, \"$listdir/$clean_list.new\"): $!");
! chown($uid, $gid, "$listdir/$clean_list.new") ||
! &abort("chown($uid, $gid, \"$listdir/$clean_list.new\"): $!");
while (<LIST>) {
if (! &addr_match($subscriber, $_,
(&cf_ck_bool($clean_list,"mungedomain") ? 2 : undef))) {
***************
*** 423,433 ****
return;
}
# The new password is valid, too, so write it.
if (&lopen(PASSWD, ">", "$listdir/$clean_list.passwd")) {
print PASSWD $new_passwd, "\n";
&lclose(PASSWD);
# set the file mode appropriately
! chmod(0660, "$listdir/$clean_list.passwd");
print REPLY "Password changed.\n";
} else {
&abort("Can't open $listdir/$clean_list.passwd: $!");
--- 423,436 ----
return;
}
# The new password is valid, too, so write it.
+ local($mode, $uid, $gid) =
+ ((stat("$listdir/$clean_list.passwd"))[2,4,5]) || (0660);
if (&lopen(PASSWD, ">", "$listdir/$clean_list.passwd")) {
print PASSWD $new_passwd, "\n";
&lclose(PASSWD);
# set the file mode appropriately
! chmod($mode, "$listdir/$clean_list.passwd");
! chown($uid, $gid, "$listdir/$clean_list.passwd") if defined($uid);
print REPLY "Password changed.\n";
} else {
&abort("Can't open $listdir/$clean_list.passwd: $!");
***************
*** 590,595 ****
--- 593,600 ----
if (&valid_passwd($listdir, $clean_list, $passwd)) {
# The password is valid, so write the new info
local (@time) = localtime if &cf_ck_bool($clean_list,"date_info");
+ local($mode, $uid, $gid) =
+ ((stat("$listdir/$clean_list.info"))[2,4,5]) || (0664);
if (&lopen(INFO, ">", "$listdir/$clean_list.info")) {
print INFO "[Last updated on: ", &chop_nl(&ctime(time())),
"]\n" if &cf_ck_bool($clean_list,"date_info");
***************
*** 600,607 ****
}
print INFO $_, "\n";
}
&lclose(INFO);
- chmod(0664, "$listdir/$clean_list.info");
print REPLY "New info for list $clean_list accepted.\n";
&log("newinfo $clean_list PASSWORD");
# if we read to actual end-of-file, we are done
--- 605,614 ----
}
print INFO $_, "\n";
}
+ chmod($mode, "$listdir/$clean_list.info");
+ chown($uid, $gid, "$listdir/$clean_list.info")
+ if defined($uid);
&lclose(INFO);
print REPLY "New info for list $clean_list accepted.\n";
&log("newinfo $clean_list PASSWORD");
# if we read to actual end-of-file, we are done
***************
*** 705,710 ****
--- 712,718 ----
if (&valid_passwd($listdir, $clean_list, $passwd)) {
# The password is valid, so write the new config
# off to the side to validate it.
+ local($oldumask) = umask($config_umask);
if (&lopen(NCONFIG, ">", "$listdir/$clean_list.new.config")) {
while (<>) {
$_ = &chop_nl($_);
***************
*** 714,719 ****
--- 722,728 ----
print NCONFIG $_, "\n";
}
&lclose(NCONFIG);
+ umask($oldumask);
if ( &get_config($listdir, "$clean_list.new")) {
print REPLY "The new config file for $clean_list was NOT accepted because:\n";
***************
*** 743,749 ****
&log("newconfig $clean_list PASSWORD");
&get_config($listdir, $clean_list);
} else {
! &abort("Can't write $listdir/$clean_list.info: $!");
}
} else {
&squawk("newconfig: invalid password.");
--- 752,758 ----
&log("newconfig $clean_list PASSWORD");
&get_config($listdir, $clean_list);
} else {
! &abort("Can't write $listdir/$clean_list.config: $!");
}
} else {
&squawk("newconfig: invalid password.");
***************
*** 876,881 ****
--- 885,891 ----
local(@array) = ();
local($i, $command, $result) = ();
+ $reply_addr =~ s/\@/\\\@/g;
$result = 0;
if ($'config_opts{$list, 'advertise'} ne '') {
***************
*** 1074,1083 ****
local($list4help) = $majordomo_request ? "[<list>]" : "<list>";
! local($listrequest) = "or to \"<list>-request@$whereami\".\n";
$listrequest .= "\nThe <list> parameter is only optional if the ";
$listrequest .= "message is sent to an address\nof the form ";
! $listrequest .= "\"<list>-request@$whereami\".\n";
$listrequest = "." unless $majordomo_request;
--- 1084,1093 ----
local($list4help) = $majordomo_request ? "[<list>]" : "<list>";
! local($listrequest) = "or to \"<list>-request\@$whereami\".\n";
$listrequest .= "\nThe <list> parameter is only optional if the ";
$listrequest .= "message is sent to an address\nof the form ";
! $listrequest .= "\"<list>-request\@$whereami\".\n";
$listrequest = "." unless $majordomo_request;
***************
*** 1183,1189 ****
When the list owner approves your request, you will be notified.
If you have any questions about the policy of the list owner, please
! contact "$list-approval@$whereami".
Thanks!
--- 1193,1199 ----
When the list owner approves your request, you will be notified.
If you have any questions about the policy of the list owner, please
! contact "$list-approval\@$whereami".
Thanks!
***************
*** 1211,1224 ****
# close (and thereby send) the reply
close(REPLY);
- # delete all the temporary files; do it this long ugly way
- # because of a bug in PERL filename globbing
- $_ = `echo $tmp.*`;
- $_ = &chop_nl($_);
- foreach (split(" ", $_)) {
- unlink($_) || warn("Can't unlink $_: $!") if ! /\*$/;
- }
-
# good bye!
exit(0);
}
--- 1221,1226 ----
***************
*** 1230,1236 ****
local($subscriber) = join(" ", @_);
# Set up the sendmail process to welcome the new subscriber
! &set_mail_sender($config_opts{$list,"sender"} . "@" . $whereami);
&sendmail(MSG, $subscriber, "Welcome to $list");
&set_mail_sender($whoami_owner);
--- 1232,1238 ----
local($subscriber) = join(" ", @_);
# Set up the sendmail process to welcome the new subscriber
! &set_mail_sender($config_opts{$list,"sender"} . "\@" . $whereami);
&sendmail(MSG, $subscriber, "Welcome to $list");
&set_mail_sender($whoami_owner);
***************
*** 1242,1248 ****
If you ever want to remove yourself from this mailing list,
send the following command in email to
! "${clean_list}-request@$whereami":
unsubscribe
--- 1244,1250 ----
If you ever want to remove yourself from this mailing list,
send the following command in email to
! "${clean_list}-request\@$whereami":
unsubscribe
Index: majordomo.pl
===================================================================
RCS file: /cvs/tools/PD/majordomo/majordomo.pl,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 majordomo.pl
*** 1.1.1.1 1995/03/01 14:43:23
--- majordomo.pl 1995/04/14 14:09:54
***************
*** 80,86 ****
$ReplyTo = $array{'apparently-from'} unless $ReplyTo;
! join(", ", &main'ParseAddrs($ReplyTo)) if $ReplyTo;
$ReplyTo;
}
--- 80,86 ----
$ReplyTo = $array{'apparently-from'} unless $ReplyTo;
! $ReplyTo = join(", ", &main'ParseAddrs($ReplyTo)) if $ReplyTo;
$ReplyTo;
}
***************
*** 108,114 ****
# strip harmless matched leading and trailing angle brackets off the list
1 while $taint_list =~ s/^<(.*)>$/\1/;
# strip harmless trailing "@.*" off the list
! $taint_list =~ s/@.*$//;
# anything else funny with $taint_list probably isn't harmless; let's check
# start with $clean_list the same as $taint_list
local($clean_list) = $taint_list;
--- 108,114 ----
# strip harmless matched leading and trailing angle brackets off the list
1 while $taint_list =~ s/^<(.*)>$/\1/;
# strip harmless trailing "@.*" off the list
! $taint_list =~ s/\@.*$//;
# anything else funny with $taint_list probably isn't harmless; let's check
# start with $clean_list the same as $taint_list
local($clean_list) = $taint_list;
***************
*** 166,173 ****
if ($partial == 2) { # see if addresses are foo@baz.bax.edu, foo@bax.edu
local(@addr1,@addr2);
! @addr1 = split(/@/, $a1[0]);
! @addr2 = split(/@/, $a2[0]);
if ( $#addr1 == $#addr2 && $#addr1 == 1 &&
$addr1[0] eq $addr2[0] && (index($addr1[1], $addr2[1]) >= $[))
{
--- 166,173 ----
if ($partial == 2) { # see if addresses are foo@baz.bax.edu, foo@bax.edu
local(@addr1,@addr2);
! @addr1 = split(/\@/, $a1[0]);
! @addr2 = split(/\@/, $a2[0]);
if ( $#addr1 == $#addr2 && $#addr1 == 1 &&
$addr1[0] eq $addr2[0] && (index($addr1[1], $addr2[1]) >= $[))
{
***************
*** 241,255 ****
}
# Globals referenced by &set_mail* and &sendmail
- $mail_prog = "/usr/lib/sendmail -f\$sender -t";
$mail_from = "Majordomo";
$mail_sender = "Majordomo-Owner";
- # set the mailer
- sub main'set_mailer {
- $mail_prog = shift;
- }
-
# set the default from address
sub main'set_mail_from {
$mail_from = shift;
--- 241,249 ----
***************
*** 282,291 ****
$to = join(", ", @to);
# open the process
! local(@mailer, $mailer);
! eval "\$mailer = \"$mail_prog\"";
! @mailer = split(' ', $mailer);
! open($MAIL, "|-") || &main'do_exec_sendmail(@mailer);
# generate the header. Note the line beginning with "-"; this keeps
# this message from being reprocessed by Majordomo if some misbegotten
--- 276,283 ----
$to = join(", ", @to);
# open the process
! open($MAIL, "|-")
! || &main'do_exec_sendmail($main'SENDMAIL, "-f$sender", "-t");
# generate the header. Note the line beginning with "-"; this keeps
# this message from being reprocessed by Majordomo if some misbegotten
***************
*** 393,401 ****
if (!$main'no_x400at) {
print "$components[$#components]\n"
! if ( "$components[$#components]" !~ /@/); #'
! &main'abort("HOSTILE ADDRESS $addr no @ in last component")
! if ( "$components[$#components]" !~ /@/); #'
} #'
# check to see that the c= and a[dm]= parts exist in the X.400
--- 385,393 ----
if (!$main'no_x400at) {
print "$components[$#components]\n"
! if ( "$components[$#components]" !~ /\@/); #'
! &main'abort("HOSTILE ADDRESS $addr no \@ in last component")
! if ( "$components[$#components]" !~ /\@/); #'
} #'
# check to see that the c= and a[dm]= parts exist in the X.400
Index: medit
===================================================================
RCS file: /cvs/tools/PD/majordomo/medit,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 medit
*** 1.1.1.1 1995/03/01 14:43:23
--- medit 1995/04/14 13:33:34
***************
*** 16,24 ****
# set our path explicitly
$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
- # What shall we use for temporary files?
- $tmp = "/tmp/medit.$$";
-
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
if ($ARGV[0] eq "-C") {
--- 16,21 ----
Index: new-list
===================================================================
RCS file: /cvs/tools/PD/majordomo/new-list,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 new-list
*** 1.1.1.1 1995/03/01 14:43:24
--- new-list 1995/04/14 14:13:16
***************
*** 12,20 ****
# set our path explicitly
$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
- # What shall we use for temporary files?
- $tmp = "/tmp/majordomo.$$";
-
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
if ($ARGV[0] eq "-C") {
--- 12,17 ----
***************
*** 38,59 ****
$list = $ARGV[0];
open(MAIL, "|-") ||
! &do_exec_sendmail(split(' ',
! "/usr/lib/sendmail -f$list-approval -t"));
print MAIL <<"EOM";
To: $reply_to
Cc: $list-approval
From: $list-approval
! Subject: Your mail to $list@$whereami
In-Reply-To: $in_reply_to
! Reply-To: $list-approval@$whereami
This pre-recorded message is being sent in response to your recent
! email to $list@$whereami.
If you were trying to subscribe to the list, please send your request
! to $whoami, not to $list@$whereami.
This is a new list. Your message is being returned unsent, but please
hold on to it. After a few days, when the flood of subscription
--- 35,55 ----
$list = $ARGV[0];
open(MAIL, "|-") ||
! &do_exec_sendmail($SENDMAIL, "-f$list-approval", "-t");
print MAIL <<"EOM";
To: $reply_to
Cc: $list-approval
From: $list-approval
! Subject: Your mail to $list\@$whereami
In-Reply-To: $in_reply_to
! Reply-To: $list-approval\@$whereami
This pre-recorded message is being sent in response to your recent
! email to $list\@$whereami.
If you were trying to subscribe to the list, please send your request
! to $whoami, not to $list\@$whereami.
This is a new list. Your message is being returned unsent, but please
hold on to it. After a few days, when the flood of subscription
Index: request-answer
===================================================================
RCS file: /cvs/tools/PD/majordomo/request-answer,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 request-answer
*** 1.1.1.1 1995/03/01 14:43:24
--- request-answer 1995/04/14 14:11:35
***************
*** 10,19 ****
# $Locker: $
# set our path explicitly
! $ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
!
! # What shall we use for temporary files?
! $tmp = "/tmp/majordomo.$$";
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
--- 10,17 ----
# $Locker: $
# set our path explicitly
! # PATH it is set in the wrapper, so there is no need to set it here.
! #$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
***************
*** 29,34 ****
--- 27,33 ----
chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
unshift(@INC, $homedir);
+ require "shlock.pl";
require "majordomo.pl";
&ParseMailHeader(STDIN, *hdrs);
***************
*** 37,58 ****
$in_reply_to = $hdrs{"message-id"} . ", from " . $hdrs{"from"};
$list = $ARGV[0];
! sub do_exec_sendmail {
! exec("/usr/lib/sendmail", "-f$list-request", "-t") ||
! die("Failed to exec sendmail");
! }
!
! open(MAIL, "|-") || &do_exec_sendmail();
print MAIL <<"EOM";
To: $reply_to
From: $list-request
! Subject: Your mail to $list-request@$whereami
In-Reply-To: $in_reply_to
! Reply-To: $list-approval@$whereami
This pre-recorded message is being sent in response to your recent
! email to $list-request@$whereami.
All routine administrative requests (including subscriptions and
unsubscriptions) concerning this mailing list are handled by an
--- 36,52 ----
$in_reply_to = $hdrs{"message-id"} . ", from " . $hdrs{"from"};
$list = $ARGV[0];
! open(MAIL, "|-") || &do_exec_sendmail($SENDMAIL, "-f$list-approval", "-t");
print MAIL <<"EOM";
To: $reply_to
From: $list-request
! Subject: Your mail to $list-request\@$whereami
In-Reply-To: $in_reply_to
! Reply-To: $list-approval\@$whereami
This pre-recorded message is being sent in response to your recent
! email to $list-request\@$whereami.
All routine administrative requests (including subscriptions and
unsubscriptions) concerning this mailing list are handled by an
Index: resend
===================================================================
RCS file: /cvs/tools/PD/majordomo/resend,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 resend
*** 1.1.1.1 1995/03/01 14:43:24
--- resend 1995/04/17 15:50:45
***************
*** 18,27 ****
#
# set our path explicitly
! $ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
!
! # What shall we use for temporary files?
! $tmp = "/tmp/majordomo.$$";
# Before doing anything else tell the world I am resend
# The mj_ prefix is reserved for tools that are part of majordomo proper.
--- 18,25 ----
#
# set our path explicitly
! # PATH it is set in the wrapper, so there is no need to set it here.
! #$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
# Before doing anything else tell the world I am resend
# The mj_ prefix is reserved for tools that are part of majordomo proper.
***************
*** 32,38 ****
# from "filename", and shove them onto the ARGV for later processing
# by &Getopts()
! if ($ARGV[0] =~ /^@/) {
$fn = shift(@ARGV);
$fn =~ s/^@//;
open(AV, $fn) || die("open(AV, \"$fn\"): $!\nStopped");
--- 30,36 ----
# from "filename", and shove them onto the ARGV for later processing
# by &Getopts()
! if ($ARGV[0] =~ /^\@/) {
$fn = shift(@ARGV);
$fn =~ s/^@//;
open(AV, $fn) || die("open(AV, \"$fn\"): $!\nStopped");
***************
*** 76,82 ****
die("resend: must specify outgoing list as last arg(s)");
}
! $opt_r = "$opt_r@$opt_h" if ( defined($opt_r) );
&get_config($listdir, $opt_l);
--- 74,80 ----
die("resend: must specify outgoing list as last arg(s)");
}
! $opt_r = "$opt_r\@$opt_h" if ( defined($opt_r) );
&get_config($listdir, $opt_l);
***************
*** 120,126 ****
die("resend: must also specify '-a passwd' if using '-A' flag");
}
! $sender = "$sendmail_sender@$opt_h";
&open_temp(OUT, "/tmp/resend.$$.out") ||
&abort("resend:1 Can't open /tmp/resend.$$.out: $!");
--- 118,124 ----
die("resend: must also specify '-a passwd' if using '-A' flag");
}
! $sender = "$sendmail_sender\@$opt_h";
&open_temp(OUT, "/tmp/resend.$$.out") ||
&abort("resend:1 Can't open /tmp/resend.$$.out: $!");
***************
*** 347,366 ****
if (defined($opt_A) && ! defined($approved)) {
&bounce("Approval required");
}
!
! $sendmail_cmd = "/usr/lib/sendmail $opt_m -f$sendmail_sender " .
! join(" ", @ARGV);
if (defined($opt_d)) {
$| = 1;
! print "Command: $sendmail_cmd\n";
$status = (system("cat /tmp/resend.$$.out") >> 8);
unlink(</tmp/resend.$$.*>);
exit($status);
} else {
! local(*MAILOUT, *MAILIN, @mailer);
! @mailer = split(' ', "$sendmail_cmd");
! open(MAILOUT, "|-") || &do_exec_sendmail(@mailer);
open(MAILIN, "/tmp/resend.$$.out");
while (<MAILIN>) {
print MAILOUT $_;
--- 345,363 ----
if (defined($opt_A) && ! defined($approved)) {
&bounce("Approval required");
}
!
! $sendmail_cmd = "$SENDMAIL $opt_m -f$sendmail_sender " . join(" ", @ARGV);
if (defined($opt_d)) {
$| = 1;
! $, = ' ';
! print "Command: ", $sendmail_cmd, "\n";
$status = (system("cat /tmp/resend.$$.out") >> 8);
unlink(</tmp/resend.$$.*>);
exit($status);
} else {
! local(*MAILOUT, *MAILIN);
! open(MAILOUT, "|-") || &do_exec_sendmail(split(' ', $sendmail_cmd));
open(MAILIN, "/tmp/resend.$$.out");
while (<MAILIN>) {
print MAILOUT $_;
***************
*** 437,443 ****
local($reason) = shift;
local($_);
! &resend_sendmail(BOUNCE, $sender, "BOUNCE $opt_l@$opt_h: $reason");
seek(IN, 0, 0);
while (<IN>) {
--- 434,440 ----
local($reason) = shift;
local($_);
! &resend_sendmail(BOUNCE, $sender, "BOUNCE $opt_l\@$opt_h: $reason");
seek(IN, 0, 0);
while (<IN>) {
***************
*** 464,473 ****
if (defined($opt_d)) {
# debugging, so just say it, don't do it
open(MAIL, ">-");
! print MAIL ">>> /usr/lib/sendmail -f$sendmail_sender -t\n";
} else {
! local(@mailer) = split(' ',"/usr/lib/sendmail -f$sendmail_sender -t");
! open(MAIL, "|-") || &do_exec_sendmail(@mailer);
}
# generate the header
--- 461,470 ----
if (defined($opt_d)) {
# debugging, so just say it, don't do it
open(MAIL, ">-");
! print MAIL ">>> $SENDMAIL -f$sendmail_sender -t\n";
} else {
! open(MAIL, "|-")
! || &do_exec_sendmail($SENDMAIL, "-f$sendmail_sender", "-t");
}
# generate the header
Index: sample.cf
===================================================================
RCS file: /cvs/tools/PD/majordomo/sample.cf,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 sample.cf
*** 1.1.1.1 1995/03/01 14:43:24
--- sample.cf 1995/04/18 15:18:18
***************
*** 2,11 ****
$whereami = "foo.GreatCircle.COM";
# $whoami -- Who do users send requests to me as?
! $whoami = "Majordomo@$whereami";
# $whoami_owner -- Who is the owner of the above, in case of problems?
! $whoami_owner = "Majordomo-Owner@$whereami";
# $homedir -- Where can I find my extra .pl files, like majordomo.pl?
# the environment variable HOME is set by the wrapper
--- 2,11 ----
$whereami = "foo.GreatCircle.COM";
# $whoami -- Who do users send requests to me as?
! $whoami = "Majordomo\@$whereami";
# $whoami_owner -- Who is the owner of the above, in case of problems?
! $whoami_owner = "Majordomo-Owner\@$whereami";
# $homedir -- Where can I find my extra .pl files, like majordomo.pl?
# the environment variable HOME is set by the wrapper
***************
*** 28,39 ****
# $log -- Where do I write my log?
$log = "$homedir/Log";
! # $mailer -- What program and args do I use to send mail?
! # The variable $to can be interpolated into this command line,
! # however the $to variable is provided by the person sending mail,
! # and much mischief can be had by playing with this variable.
! # Use $to with care.
! $mailer = "/usr/lib/sendmail -f\$sender -t";
# Majordomo will look for "get" and "index" files related to $list in
# directory "$filedir/$list$filedir_suffix", so set $filedir and
--- 28,37 ----
# $log -- Where do I write my log?
$log = "$homedir/Log";
! # Since most of the programs assume sendmail options, let's quit
! # pretending Majordomo works with anything else and simply allow
! # specification of where sendmail lives, which is the real issue.
! $SENDMAIL = "/usr/lib/sendmail";
# Majordomo will look for "get" and "index" files related to $list in
# directory "$filedir/$list$filedir_suffix", so set $filedir and
***************
*** 53,59 ****
# If you want to use FTPMAIL, rather than local access, for file transfer
# and access, define the following:
! # $ftpmail_address = "ftpmail@decwrl.dec.com";
# $ftpmail_location = "FTP.$whereami";
# if you want the subject of the request to be included as part of the
--- 51,57 ----
# If you want to use FTPMAIL, rather than local access, for file transfer
# and access, define the following:
! # $ftpmail_address = "ftpmail\@decwrl.dec.com";
# $ftpmail_location = "FTP.$whereami";
# if you want the subject of the request to be included as part of the
***************
*** 68,74 ****
# Set the umask for the process. Used to set default file status for
# config file.
! umask(007);
# the safe locations for archive directories. This should be defined as
# a series of root anchored directory paths as will be used as prefixes
--- 66,72 ----
# Set the umask for the process. Used to set default file status for
# config file.
! $config_umask = 007;
# the safe locations for archive directories. This should be defined as
# a series of root anchored directory paths as will be used as prefixes
Index: wrapper.c
===================================================================
RCS file: /cvs/tools/PD/majordomo/wrapper.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 wrapper.c
*** 1.1.1.1 1995/03/01 14:43:24
--- wrapper.c 1995/03/21 22:23:43
***************
*** 16,21 ****
--- 16,22 ----
#include <stdio.h>
#ifndef STRCHR
+ # include <string.h>
# define STRCHR(s,c) strchr(s,c)
#endif
***************
*** 96,105 ****
#if defined(SETGROUP)
/* renounce any previous group memberships if we are running as root */
if (geteuid() == 0) { /* Should I exit if this test fails? */
! char setgroups_used = "setgroups_was_included"; /* give strings a hint */
int groups[] = { POSIX_GID, 0 };
! if (setgroups(1, groups) != 0) {
extern int errno;
fprintf(stderr, "%s: error setgroups failed errno %d", argv[0],
--- 97,106 ----
#if defined(SETGROUP)
/* renounce any previous group memberships if we are running as root */
if (geteuid() == 0) { /* Should I exit if this test fails? */
! char *setgroups_used = "setgroups_was_included"; /* give strings a hint */
int groups[] = { POSIX_GID, 0 };
! if (setgroups(1, groups) == -1) {
extern int errno;
fprintf(stderr, "%s: error setgroups failed errno %d", argv[0],
Index: contrib/archive2.pl
===================================================================
RCS file: /cvs/tools/PD/majordomo/contrib/archive2.pl,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 archive2.pl
*** 1.1.1.1 1995/03/01 14:43:29
--- archive2.pl 1995/04/20 18:11:03
***************
*** 36,50 ****
# -m -a"
# set our path explicitly
! $ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
! # What shall we use for temporary files?
! $tmp = "/tmp/majordomo.$$";
!
! #Tell the work who we are The use of the mj prefix is a bit
! # too soon since it isn't config file cognisent, but that should
! # come along in the 1.91 patch I guess.
! $main'program_name = 'mj_archive';
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
--- 36,45 ----
# -m -a"
# set our path explicitly
! # PATH it is set in the wrapper, so there is no need to set it here.
! #$ENV{'PATH'} = "/bin:/usr/bin:/usr/ucb";
! ($program_name = $0) =~ s|.*/(.*)(\.pl)?||;
# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
***************
*** 65,70 ****
--- 60,69 ----
require "majordomo.pl"; # all sorts of general-purpose Majordomo subs
require "shlock.pl"; # NNTP-style file locking
+ $hostname = &chop_nl(`hostname`);
+ &set_abort_addr($whoami_owner);
+ &set_log($log, $hostname, $program_name, "UNKNOWN");
+
# Here's where the fun begins...
require "getopts.pl";
***************
*** 82,87 ****
--- 81,87 ----
print STDERR "'-f <list>' required\n$usage\n";
exit 1;
}
+ &set_log($log, $hostname, $program_name, $opt_f);
if (!defined(@archive_dirs)) {
&abort("\@archive_dirs not defined in majordomo.cf! Aborting.\n");
--
Dave Wolfe *Not a spokesman for Motorola* (512) 891-3246
Motorola MMTG 6501 Wm. Cannon Dr. W. OE112 Austin TX 78735-8598
|
|