From c7cc448801f8b6f10cdd0d86568180687173f03e Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 18 Apr 2012 03:23:44 +0200 Subject: wibble --- fripost-newdomain | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'fripost-newdomain') 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<< >> -- cgit v1.2.3