thomas: utils/admin kolab-mailboxinfo.pl,NONE,1.1

cvs at kolab.org cvs at kolab.org
Fri Jun 22 17:37:03 CEST 2007


Author: thomas

Update of /kolabrepository/utils/admin
In directory doto:/tmp/cvs-serv13654

Added Files:
	kolab-mailboxinfo.pl 
Log Message:
Add script to list acls and non-cmu-annotations of all local cyrus mailboxes.
Management login information is read from Kolab server configuration.


--- NEW FILE: kolab-mailboxinfo.pl ---
#!/kolab/bin/perl
#
# Copyright 2007 by Intevation GmbH <intevation at intevation.de>
# Author(s):
# Thomas Arendsen Hein <thomas at intevation.de>
# 
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
#
#
# List acls and non-cmu-annotations of all local cyrus mailboxes.
# Management login information is read from Kolab server configuration.
#
# $Id: kolab-mailboxinfo.pl,v 1.1 2007/06/22 15:37:00 thomas Exp $

use Kolab::Cyrus;

my $cyrus = Kolab::Cyrus::create;
$cyrus || die 'Unable to login to Cyrus IMAP server\n';

my @results = $cyrus->listmailbox('*');
sort(@results);
foreach my $result (@results) {
    my $mailbox = shift(@{$result});

    my %rights = $cyrus->listacl(${mailbox});
    foreach my $user (sort keys %rights) {
        print "${mailbox}: acl $user: $rights{$user}\n";
    }

    my %info = $cyrus->getinfo(${mailbox});
    foreach my $key (sort keys %info) {
        $attrib = $key;
        $attrib =~ s/^[^}]*}//;
        if(not $attrib =~ /^\/vendor\/cmu\//) {
            print "${mailbox}: annotation $attrib: $info{$key}\n";
        }
    }
}

# vim:set sw=4 ts=8 sts=4 sta et:





More information about the commits mailing list