diff options
author | Jonas Smedegaard <dr@jones.dk> | 2020-11-13 01:07:10 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2020-11-13 01:07:10 +0100 |
commit | 39b02cf337b2ce0e54d7c045e01eb9931162ba03 (patch) | |
tree | 7039a68b9f4f465fa1a95a30a5925a499adece6f | |
parent | ff24b826e7381ffc1cc80348b822538beb6389bd (diff) |
fix revive support for locally overridden variables, and quoting of singular SENDERFILTER
-rwxr-xr-x | mailman/mklist.pl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mailman/mklist.pl b/mailman/mklist.pl index 7893ad7..d0f2549 100755 --- a/mailman/mklist.pl +++ b/mailman/mklist.pl @@ -4,7 +4,7 @@ use warnings; -our ($listname, $listdesc, $listhost, $senders, $senderfilter, $listowner, $moderators); +our ($listname, $listdesc, $listhost, $senders, $senderfilter, $senderfilters, $listowner, $listowners, $moderator, $moderators); # Load optional config my $config_file_addon_org = "/etc/local-ORG/mailman/mklist.conf"; @@ -15,15 +15,15 @@ if ( -f $config_file_addon_org ) { warn "Ignoring non-existing file $config_file_addon_org"; } -$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"; -$senderfilters = $ENV{'SENDERFILTER'} || $ENV{'SENDERFILTERS'} || '' +$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"; +$senderfilters ||= $ENV{'SENDERFILTERS'} || "'$senderfilter'" || "'$ENV{'SENDERFILTER'}'" || '' or warn "Ignoring missing SENDERFILTER(S)"; -$listowners = $ENV{'LISTOWNERS'} || "'$ENV{'LISTOWNER'}'" +$listowners ||= $ENV{'LISTOWNERS'} || "'$listowner'" || "'$ENV{'LISTOWNER'}'" or die "LISTOWNER(S) missing"; -$moderators = $ENV{'MODERATORS'} || "'$ENV{'MODERATOR'}'"; +$moderators ||= $ENV{'MODERATORS'} || "'$moderator'" || "'$ENV{'MODERATOR'}'"; while (<>) { # Replace keywords - except in comments |