aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-searchalias
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-05-03 19:47:20 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-05-03 19:47:20 +0200
commita6bd894f302df904588df739f79f1b17b329a0e4 (patch)
tree482330ebaed111143282737863fe1db8395465a0 /fripost-searchalias
parentb0460b1b8fb61569d20cbd4ac75ae6976bd34a92 (diff)
Adding debug messages.
Diffstat (limited to 'fripost-searchalias')
-rwxr-xr-xfripost-searchalias7
1 files changed, 7 insertions, 0 deletions
diff --git a/fripost-searchalias b/fripost-searchalias
index 0775942..2e5d35f 100755
--- a/fripost-searchalias
+++ b/fripost-searchalias
@@ -118,6 +118,13 @@ my %alias;
$alias{goto} = $ARGV[0] if defined $ARGV[0];
$alias{address} = $ARGV[1] if defined $ARGV[1];
+if (defined $alias{address}) {
+ my ($u,$d) = split /\@/, $alias{address}, 2;
+ $d = $u if (defined $u) and not (defined $d);
+ $ldap->domain->search({ domain => $d })->count
+ or die "Error: Unknown domain `$d'.\n";
+}
+
foreach my $alias ($ldap->alias->search( \%alias )->entries) {
say "From: " . (join ', ', @{$alias->{address}});
say "Goto: " . $alias->{goto};