diff options
Diffstat (limited to 'fripost-searchalias')
-rwxr-xr-x | fripost-searchalias | 7 |
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}; |