how to use cyradm in a not-so-interactive way?

Kai k1680792 at yahoo.co.jp
Mon Oct 13 03:40:34 EDT 2003


Hi
Use the following scripts

#!/usr/bin/perl
use Cyrus::IMAP::Admin;
my $client=Cyrus::IMAP::Admin->new('yourhost');
$client->authenticate(-authz=>'',
                        -user=>'admin',
                        -password=>'yourpasswordhere',
                        -mechanism=>'PLAIN');
my $result=$client->createmailbox("$mailbox");

Regards
Kai

> I am trying to automate some tasks in order to create new mail
> accounts... I am using Postfix, Cyrus-IMAP and MySQL.
> Maybe there is a quite obvious answer to this question but I have no
> idea about Perl...
> I would like to find a way to create users in a not-so-interactive way
> like introducing directly these commands (for example). To do this I
> have to connect to cyradm (e.g.,cyradm --user cyrus --server localhost)
> from the terminal and then introduce:
>
> localhost> cm user.test0004
> localhost> sam user.test0004 cyrus lrswipcda
> localhost> sq user.test0004 20000
> localhost> quit
>
> In the man page of cyradm it says it can be used in this other way:
>  perl -MCyrus::IMAP::Shell -e 'run("myscript")'
> but, honestly, I can not understand how to do this. What should be the
> content of "myscript"? how to connect to cyradm in this case? how to
> provide the password?
>
> Any help would be very grateful!
>
> Greetings!
> Javier Cano


__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/





More information about the Info-cyrus mailing list