diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-10-30 20:52:53 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-10-30 20:54:20 +0200 |
commit | ebe00b93646ff68cc522a2f30c6f5e3a12d00d2b (patch) | |
tree | aa90f9aceb452ec5a2c74d3d201f5039548704f3 /mailman/mklist.pl | |
parent | bf2cf9c38a59a291cc74e2910cf29ec04686e11a (diff) |
Add plural senderfilters and listowners (and read corresponding environment variables) to support arrays of strings.
Diffstat (limited to 'mailman/mklist.pl')
-rwxr-xr-x | mailman/mklist.pl | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mailman/mklist.pl b/mailman/mklist.pl index 847234b..b80b1ac 100755 --- a/mailman/mklist.pl +++ b/mailman/mklist.pl @@ -4,7 +4,7 @@ use warnings; -our ($listname, $listdesc, $listhost, $senders, $senderfilter, $listowner); +our ($listname, $listdesc, $listhost, $senders, $senderfilter, $senderfilters, $listowner, $listowners); # Load optional config my $config_file_addon_org = "/etc/local-ORG/mailman/mklist.conf"; @@ -18,8 +18,14 @@ $listname ||= $ENV{'LISTNAME'} or die "LISTNAME missing"; $listdesc ||= $ENV{'LISTDESC'} or die "LISTDESC missing"; $listhost ||= $ENV{'LISTHOST'} or die "LISTHOST missing"; $senders ||= $ENV{'SENDERS'} or die "SENDERS missing"; -$senderfilter ||= $ENV{'SENDERFILTER'} or die "SENDERFILTER missing"; -$listowner ||= $ENV{'LISTOWNER'} or die "LISTOWNER missing"; +$senderfilter ||= $ENV{'SENDERFILTER'}; +$senderfilter ||= ''; +$senderfilters ||= $ENV{'SENDERFILTERS'}; +$senderfilters ||= "'" . $senderfilter ."'" or die "SENDERFILTER(S) missing"; +$listowner ||= $ENV{'LISTOWNER'}; +$listowner ||= ''; +$listowners ||= $ENV{'LISTOWNERS'}; +$listowners ||= "'" . $listowner . "'" or die "LISTOWNER(S) missing"; while (<>) { # Replace keywords - execept in comments @@ -27,8 +33,8 @@ while (<>) { s/^([^#]*)LISTDESC/$1$listdesc/g; s/^([^#]*)LISTHOST/$1$listhost/g; s/^([^#]*)SENDERS/$1$senders/g; - s/^([^#]*)SENDERFILTER/$1$senderfilter/g; - s/^([^#]*)LISTOWNER/$1$listowner/g; + s/^([^#]*)SENDERFILTERS/$1$senderfilters/g; + s/^([^#]*)LISTOWNERS/$1$listowners/g; print; } |