Cyradm -- Administration Port
    Jonathan Marsden 
    jonathan at bach.xc.org
       
    Fri Nov 29 15:43:08 EST 2002
    
    
  
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: jonathan at xc.org	| 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 
    
    
More information about the Info-cyrus
mailing list