SME Server's panel to create simple list. It works like groups email, except that you can enter raw (including external) email addresses instead of having to select existing user accounts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.3 KiB

12 years ago
#!/usr/bin/perl -w
package esmith;
use strict;
use Errno;
use esmith::ConfigDB;
use esmith::AccountsDB;
use esmith::util;
my $c = esmith::ConfigDB->open_ro || die "Couldn't open config db\n";
my $a = esmith::AccountsDB->open_ro || die "Couldn't open accounts db\n";
my $event = $ARGV [0] || die "Event name arg missing\n";;
my @lists;
if ($ARGV[1]){
@lists = $a->get($ARGV[1]);
}
@lists = $a->get_all_by_prop(type=>'minilist')
if (scalar @lists lt 1);
foreach my $list (@lists){
my $name = $list->key;
# dots must be escaped by replacing them with a :
# see http://www.lifewithqmail.com/lwq.html#dots-in-extensions
$name =~ s/\./:/g;
12 years ago
unless ($list->prop('type') eq 'minilist'){
warn "Account $name is not a mailinglist account.\n";
next;
}
my $members = $list->prop('Members') || '';
esmith::util::processTemplate(
{
CONFREF =>
{
Members => $members,
},
TEMPLATE_PATH =>
"/var/qmail/alias/.qmail-group",
OUTPUT_FILENAME => "/var/qmail/alias/.qmail-$name",
}
);
unless (-f "/var/qmail/alias/.qmail-$name-default"){
symlink "/var/qmail/alias/.qmail-$name",
"/var/qmail/alias/.qmail-$name-default";
}
}
exit (0);