summaryrefslogtreecommitdiff
path: root/mail/majordomo/patches/patch-am
blob: 1e79a35ce21bd0a02251f41ad6c17b47092906ab (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
54
55
$NetBSD: patch-am,v 1.2 2010/08/20 21:25:02 tron Exp $

--- approve.orig	1997-04-05 20:18:36.000000000 +0100
+++ approve	2010-08-20 22:22:40.000000000 +0100
@@ -137,6 +137,7 @@
 
 sub process_approve {
     local($FILE) = shift;
+    my @words;
     while (<$FILE>) {
 	if ((/^\tsubscribe\s/) || (/^\tunsubscribe\s/)) {
 	    if (!defined($reply_to)) {
@@ -144,8 +145,8 @@
 		exit(1);
 	    }
 	    s/^\t//;
-	    split;
-	    $list = $_[1];
+	    @words = split;
+	    $list = $words[1];
 	    $list =~ tr/A-Z/a-z/;
 	    $passwd = $passwd{"$list\@$reply_to"};
 	    if (! $passwd) {
@@ -214,6 +215,11 @@
 	    $from_skipped = 1;
 	    next;
 	}
+	if (/^delivered-to: $post_to/i) {
+		# Remove Delivered-To: lines that point to the list, since they
+		# will cause postfix to think that the message is looping.
+		next;
+	}
 	s/^~/~~/;
 	print MAIL $_;
     }
@@ -231,12 +237,13 @@
 	s/\n$//;
 	s/#.*//;
 	if (/^$/) { next; }
-	split;
-	$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
+	my @words = split;
+
+	$l = $words[0];	$l =~ tr/A-Z/a-z/;	# list
+	$p = $words[1];				# password
+	$m = $words[2];	$m =~ tr/A-Z/a-z/;	# majordomo@site
+	@words = split(/\@/, $m);
+	$s = $words[1];	$s =~ tr/A-Z/a-z/;	# site
 
 	$passwd{$l} = $p;
 	$passwd{"$l\@$m"} = $p;