diff options
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 c15d799..8c7e72c 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 warn "Ignoring missing SENDERFILTER(S)"; +$listowner ||= $ENV{'LISTOWNER'}; +$listowner ||= ''; +$listowners ||= $ENV{'LISTOWNERS'}; +$listowners ||= "'" . $listowner . "'" or die "LISTOWNER(S) missing"; while (<>) { # Replace keywords - except in comments @@ -28,8 +34,8 @@ while (<>) { s/^([^#]*)LISTHOST/$1$listhost/g if ($listhost); s/^([^#]*)LISTHOST/#$1/g unless ($listhost); 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; } |