summaryrefslogtreecommitdiff
path: root/mail/majordomo/patches/patch-ai
blob: 270e1f9ec115df5331a90b16992af1709a06c75b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$NetBSD: patch-ai,v 1.3 2011/01/29 17:16:33 spz Exp $

--- resend.orig	2000-01-07 15:32:39.000000000 +0000
+++ resend
@@ -78,8 +78,8 @@ if (! defined($opt_l)) {
   die("resend: must specify '-l list'");
 }
     
-# Read and execute the .cf file
-$cf = $opt_C || $opt_c || $ENV{"MAJORDOMO_CF"} || "/etc/majordomo.cf";
+# Read and execute the .cf file. For security reasons, let the environment win
+$cf = $ENV{"MAJORDOMO_CF"} || $opt_C || $opt_c || "/etc/majordomo.cf";
 
 # Despite not having a place to send the remains of the body,
 # it would be nice to send a message to root or postmaster, at least...
@@ -92,6 +92,7 @@ require "$cf";
 
 chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
 
+unshift(@INC, $bindir);
 unshift(@INC, $homedir);
 require "ctime.pl";  # For logging purposes
 require "majordomo.pl";
@@ -316,7 +317,7 @@ $is_admin_header .= "\$taboo = \"\";\n};
 if (! defined($admin_body)) {
     &bitch("resend:  \$admin_body not defined in $cf !!\n" .
 	   "Majordomo will only catch \"subscribe\" and \"unsubscribe\" in\n" .
-	   "the body.\nLook at $homedir/sample.cf for a good definition.");
+	   "the body.\nLook at $bindir/sample.cf for a good definition.");
     @admin_body = ('/^subject:\s*subscribe\b/i' ,
 		      '/^subject:\s*unsubscribe\b/i');
 } else {
@@ -747,12 +748,20 @@ sub parse_header {
 
     # add new header fields
     print OUT "Sender: $sender\n";
+    print OUT "List-Id: ".$opt_l.".".$whereami."\n";
+
     if (defined($opt_p)) {
 	print OUT "Precedence: $opt_p\n";
     }
 
     if (defined($opt_r)) {
 	print OUT "Reply-To: ", &config'substitute_values($opt_r), "\n";   #';
+	if (defined $reply_to) {
+	    print OUT "Mail-Reply-To: $reply_to\n";   #';
+	} else {
+	    print OUT "Mail-Reply-To: $from\n";   #';
+	}
+	print OUT "Mail-Followup-To: ", &config'substitute_values($opt_r), "\n";   #';
     }
     
     # print out per-list additonal headers