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

Javier Cano Linares javiercano at universia.net
Wed Oct 15 03:33:52 EDT 2003


Hi, Kai and people!

Thanks a lot!

Now it works. Just one more question. I read the API documentation for
Cyrus::IMAP::Admin but I can not really understand how to set the
mailbox quota. In the perl file Admin.pm you can see:

"=item setquota($mailbox,$resource,$quota[, ...])

Set quota on a mailbox. Note that Cyrus currrently only defines one
resource, C<STORAGE>. As defined in RFC 2087, the units are groups of
1024 octects (i.e.Kilobytes)"

I do not know how to call this function, I suppose something like (but
exactly how?):
setquota('user.test0004',???,20000);

regards
Javier Cano

El lun, 13-10-2003 a las 09:40, Kai escribió:
> 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