bernhard: utils/admin listannotations.pl,NONE,1.1
cvs at intevation.de
cvs at intevation.de
Mon Feb 20 20:29:45 CET 2006
Author: bernhard
Update of /kolabrepository/utils/admin
In directory doto:/tmp/cvs-serv25111
Added Files:
listannotations.pl
Log Message:
Added listannitations.pl script.
--- NEW FILE: listannotations.pl ---
# uncomfortable example script to read out the annotations for a user
# user.a at old.example.org
# in order to create a script that can re-add them for a different domain
# and different user name.
#
# Example usage to get the file "lines" that contains the commands
# to set the annotations for user.b at new.example.org again:
#
# /kolab/bin/perl listannotations.pl | \
# grep /vendor/kolab/ | \
# sed "s+/mailbox/{\(.*\)}/vendor/kolab/\(folder-type\|incidences-for\):::\(.*\)+\$client->mboxconfig('\1', '/vendor/kolab/\2', '\3');+" | \
# sed "s+user.b\(.*\)@old.example.org+user.b\1 at new.example.org+" >lines
#
#
# 20060220 initial bernhard at intevation.de
# Tested with Kolab Server 2.1.0beta1.
#
# This script is Free Software.
# $Id: listannotations.pl,v 1.1 2006/02/20 19:29:42 bernhard Exp $
use Cyrus::IMAP::Admin;
my $client = Cyrus::IMAP::Admin->new('localhost',);
$client->authenticate(-user => 'manager', -password => 'XXXXXXX');
%info= $client->getinfo('user/user.a*@old.example.org');
foreach my $attrib (sort keys %info) {
print $attrib.":::". $info{$attrib}."\n";
}
#$client->mboxconfig('user/user.b at new.example.org','/vendor/kolab/folder-type','mail');
# insert "lines" here and rename script to "setannotations.local.pl" or so. :)
More information about the commits
mailing list