Just to put in my two cents' worth :
In case it could be of interest to anyone, here is the answer I sent directly to the requester (I know it's bad :-), but I could then write in French ! ) Roughly, as someone else stated, cyradm is just a wrapper (or something of the sort) around a Perl library. Creating users is really straightforward using that library. In the script below, the password is stored in $passwd, and the user to create is in $a
There's more information about the various commands available using
perldoc Cyrus::IMAP::Admin
I haven't gone much further than that, but if anyone is interested, feel free to ask

   Pascal Mouret
-------- Original Message --------
Subject:        Re: cyradm script
Date:   Tue, 23 Aug 2005 11:27:13 +0200
From:   Pascal Mouret <[EMAIL PROTECTED]>
To:     Patrice <[EMAIL PROTECTED]>
References:     <[EMAIL PROTECTED]>



Bonjour,

Une réponse off-list pour pouvoir parler français, c'est plus facile. Je ne sais pas si ça peut vous intéresser, mais j'ai fait ça en Perl (cyradm n'est qu'un wrapper autour de la librairie Perl associée). C'est très facile à faire :

use Cyrus::IMAP::Admin;

[...]

# connexion a Cyrus

[...]
 print "Connection a Cyrus pour la creation des boites\n";
 $client = Cyrus::IMAP::Admin->new('localhost');
$client->authenticate(-mechanism => 'login', -user => 'root', -password => $passwd);
 print STDERR "Y'a eu une erreur : ", $client->error if $client->error;


[...]
    print "Creation de la boite de messagerie $a ...";

    $rc = $client->create("user.$a");
    if($client->error)
      {die "\nY'a eu une erreur : ".$client->error."\n";}
    else
      {print " Ok\n";}
Pour plus d'infos sur les commandes qu'on peut lancer :
perldoc Cyrus::IMAP::Admin

Si vous voulez plus d'infos, n'hésitez pas
Cordialement

  Pascal Mouret


Patrice wrote:

hello,

I try to make a script to automate creation of users with cyradm
but I haven't found the way to pass the password to cyradm automatically

does somebody already did it ?

Patrice

----
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html



--
Pascal Mouret
DSII - Direction du Système d'Information et de l'Informatique
Université de Provence - 3, place Victor Hugo - 13331 Marseille cedex 3
Tél:  04 91 10 64 02            E-mail: [EMAIL PROTECTED]
Fax: 04 91 08 35 00             ou        [EMAIL PROTECTED]
(Ligne d'assistance (interne) : 04 91 10 85 55 / 04 42 95 34 54)




--
Pascal Mouret
DSII - Direction du Système d'Information et de l'Informatique
Université de Provence - 3, place Victor Hugo - 13331 Marseille cedex 3
Tél:  04 91 10 64 02            E-mail: [EMAIL PROTECTED]
Fax: 04 91 08 35 00             ou        [EMAIL PROTECTED]
(Ligne d'assistance (interne) : 04 91 10 85 55 / 04 42 95 34 54)

----
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Reply via email to