smeserver-qmail/root/etc/e-smith/templates/var/qmail/control/virtualdomains/90pseudonyms

27 lines
640 B
Plaintext

{
my $dms = $DelegateMailServer;
return "# DelegateMailServer is set" if ($dms && ($dms !~ /^\s*$/));
$OUT = "";
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";
for my $pseudo ($adb->pseudonyms)
{
next unless ($pseudo->key =~ /@/);
my $account = $pseudo->prop("Account");
$account = "admin" and warn $pseudo->prop("Account") . " is not a valid account, default to admin " unless $adb->get($account);
my $acct = $adb->get($account);
if ($acct->prop('type') eq "group")
{
$account =~ s/\./:/g;
}
$OUT .= $pseudo->key . ":$account\n";
}
}