summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2020-11-04 19:36:28 +0100
committerJonas Smedegaard <dr@jones.dk>2020-11-04 19:36:28 +0100
commit3a9f5a0505f297e0e9e34dde019a2ec76edcfca7 (patch)
tree4fbd386e7f13705770245ff4e5822db1e243158e
parente13625d03b6c83fbe052a493e4e385690c0429f9 (diff)
tidy list config mangling script
-rwxr-xr-xmailman/mklist.pl25
1 files changed, 11 insertions, 14 deletions
diff --git a/mailman/mklist.pl b/mailman/mklist.pl
index 8c7e72c..1364b0b 100755
--- a/mailman/mklist.pl
+++ b/mailman/mklist.pl
@@ -4,28 +4,25 @@
use warnings;
-our ($listname, $listdesc, $listhost, $senders, $senderfilter, $senderfilters, $listowner, $listowners);
+our ($listname, $listdesc, $listhost, $senders, $senderfilter, $listowner);
# Load optional config
my $config_file_addon_org = "/etc/local-ORG/mailman/mklist.conf";
if ( -f $config_file_addon_org ) {
- do $config_file_addon_org or die "Error in config file $config_file_addon_org: $@";
+ do $config_file_addon_org
+ or die "Error in config file $config_file_addon_org: $@";
} else {
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";
-$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";
+$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'} || ''
+ or warn "Ignoring missing SENDERFILTER(S)"
+$listowners = $ENV{'LISTOWNER'} || $ENV{'LISTOWNERS'}
+ or die "LISTOWNER(S) missing";
while (<>) {
# Replace keywords - except in comments