4

I wonder if there is a way to list all mailboxes a user has access to via cyradm (or other means). One could run lam user.% and parse the output, but I think that sucks :)

1 Answer 1

1

Answering myself after poking around with IMAP::Admin

#!/usr/bin/perl

use IMAP::Admin;

$imap = IMAP::Admin->new('Server' => 'localhost',
                           'Login' => 'cyrus',
                           'Password' => 'cyrus',
                           );

my $finduser = "root"; # the user you search for

my @mailboxes = $imap->list("user.%");
foreach my $mailbox (@mailboxes) {
        my %list = $imap->get_acl($mailbox);
        if (defined($list{$finduser})) {
                print $mailbox."\n";
        }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .