aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-newdomain
diff options
context:
space:
mode:
Diffstat (limited to 'fripost-newdomain')
-rwxr-xr-xfripost-newdomain11
1 files changed, 7 insertions, 4 deletions
diff --git a/fripost-newdomain b/fripost-newdomain
index 8ab48bf..0e1cb37 100755
--- a/fripost-newdomain
+++ b/fripost-newdomain
@@ -156,7 +156,7 @@ if (defined $conf->{owner}) {
}
else {
Email::Valid->address($conf->{owner})
- or die "Error: `" .$conf->{owner}. "' is not a valid e-mail.\n";
+ or die "Error: $conf->{owner} is not a valid e-mail.\n";
$domain{owner} = $conf->{owner};
}
}
@@ -169,7 +169,7 @@ else {
# Check that the owner exists.
die "Error: Unknown user `" .$domain{owner}. "'.\n"
unless (not defined $domain{owner})
- or $ldap->user->search($domain{owner})->count;
+ or $ldap->user->search({ username => $domain{owner} })->count;
# Check that the owner doesn't already own this very domain, or that the
# domain isn't an existing "global" domain.
@@ -223,9 +223,9 @@ sub create_alias {
my $res = $ldap->alias->search(\%alias);
if ($res->count) {
- print STDERR "WARN: Alias `" .$alias{address}. "' already exists.";
+ print STDERR "WARN: Alias $alias{address} already exists.";
print STDERR "(Targetting to ";
- print STDERR (join ', ', map { '`' .$_->{goto}. "'"} ($res->entries));
+ print STDERR (join ', ', map { $_->{goto} } ($res->entries));
say STDERR ".)";
return unless grep { $_->{goto} eq $alias{goto} } $res->entries;
}
@@ -239,6 +239,9 @@ sub create_alias {
create_alias($ldap, 'abuse@' . $domain{domain} ,'abuse@fripost.org', $domain{owner});
create_alias($ldap, 'postmaster@' . $domain{domain},'postmaster@fripost.org', $domain{owner});
+$ldap->unbind();
+
+
=head1 AUTHOR
Stefan Kangas C<< <skangas at skangas.se> >>