blob: 847234b2b6651cd47e5cb08870fd8d1a4fd17664 (
plain)
- #!/usr/bin/perl
- # TODO: derive listname from subjectprefix (which allows space and [])
- use warnings;
- 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: $@";
- } 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'} or die "SENDERFILTER missing";
- $listowner ||= $ENV{'LISTOWNER'} or die "LISTOWNER missing";
- while (<>) {
- # Replace keywords - execept in comments
- s/^([^#]*)LISTNAME/$1$listname/g;
- 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;
- print;
- }
- 1;
|