{
    my %aliases;
    my $domain=$DomainName;
    $OUT = "";

    use esmith::AccountsDB;

    my $adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";

   for my $other ( ($adb->users,$adb->get_all_by_prop(type=>"system"), $adb->groups, $adb->pseudonyms, $adb->get_all_by_prop(type=>"ibay"))  )
   {
     next if ($other->key eq "alias");
     next if ($other->key =~ /@/); #<== aliase to emails or catch-all @domain.com are NOT
     $aliases{$other->key} = $other->key;
   }
    
    my @sorted_keys = sort keys %aliases;
    foreach my $key (@sorted_keys) {
      next if $key =~ /@/;# ignore full mail pseudonyms 
      next if $key =~ /[^\x21-\x7E]/; # ignore non ascii accounts...
      $OUT .= "alias $key  $key\@$domain\n";
    }

}

