Re: Cyradm -- Administration Port

From: Jonathan Marsden (no email)
Date: Fri Nov 29 2002 - 15:43:08 EST


On 29 Nov 2002, Su Li writes:

> Does any one knows, what port does Cyradm telnet to Cyrus IMAP? Like
> Sieve, the port is 2000.
 
> So I can telnet to the administration port and issue a command:
> "setacl username1 user.username1"

There is no separate administration port for Cyrus.

Instead, cyradm issues IMAP commands using the IMAP protocol, to the
IMAP port. All the administration done by cyradm is performed using
the IMAP protocol. So that would be using port 143 (unless you choose
to set Cyrus up to use some other non-standard port for IMAP). But
you can't just send "setacl username1 user.username1" to an IMAP
server, because it only understands valid IMAP commands, and you must
authenticate first. There is a SETACL command in IMAP, so maybe:

a1 login cyrus mycyruspassword
a2 setacl user.username1 username1 lrswipcda
a3 logout

is closer to what you would have to send to TCP port 143.

In practice, is often easier to use the Perl modules that cyradm
itself uses, and do something like this:

#!/usr/bin/perl
use strict;
use Cyrus::IMAP::Admin;

my $server='localhost';
my $admin='cyrus';

my $cyradm = Cyrus::IMAP::Admin->new($server) or
    die "$0: Unable to connect to IMAP server '$server': $!" ;
$cyradm->authenticate(-user => $admin, -mechanism => 'login') or
    die "$0: Failed to authenticate to IMAP server as '$server': $!";

foreach my $user (@ARGV) {
    $cyradm->setacl("user.$user", $user => 'lrswipcda') or
        warn "$0: Unable to setacl for $user on mailbox user.$user : $!";
}

Save that script as setacl.pl and then you can do

  perl setacl.pl username1 username2 username3 username4

and have it set all of those users to have full control over their own
INBOXes.

Jonathan

--
Jonathan Marsden       	| Internet: 	| Making electronic 
1252 Judson Street  	| Phone: +1 (909) 795-3877	| communications work 
Redlands, CA 92374     	| Fax:   +1 (909) 795-0327	| reliably for Christian 
USA            		| http://www.xc.org/jonathan	| missions worldwide 







Hosted Email Solutions

Invaluement Anti-Spam DNSBLs



Powered By FreeBSD   Powered By FreeBSD