#!/usr/bin/perl -w use esmith::AccountsDB; use esmith::ConfigDB; my $a = esmith::AccountsDB->open_ro || die "Couldn't open AccountsdDB\n"; my $c = esmith::ConfigDB->open_ro || die "Couldn't open ConfigDB\n"; my $domain = $c->get('DomainName')->value; print '^Adresse(s) |membres ^' ."\n"; foreach my $group ($a->groups, $a->get_all_by_prop(type => 'minilist')){ my $name = $group->key; my $addr = $name . '@' . $domain; foreach my $pseudo ($a->pseudonyms){ my $target = $pseudo->prop('Account') || ''; if ($target eq $name){ my $p = $pseudo->key; $p .= ($pseudo->key =~ m/\@/) ? '' : "\@$domain"; $addr .= '\\\\ ' . $p; } } my @members = split ',', $group->prop('Members'); my $str = '^' . $addr . ' |'; foreach my $member (@members){ $member .= ($member =~ m/\@/) ? '' : "\@$domain"; $str .= $member . ', '; } $str =~ s/, $//; $str .= ' |' . "\n"; print $str; }