Thanks all but it looks like the perl stuff is somewhat broken, cyradm works
from the command line but everytime I run any of the scripts I've been sent
I get this error:

"Use of uninitialized value in subroutine entry at
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Cyrus/IMAP/Admin.pm line 78."

One thing to note, when I compiled and installed cyrus-imapd-2.0.16 the perl
modules Cyrus:IMAP ended up in /usr/local/lib/ but my perl is
/usr/lib/perl5/... and cyradm didn't work until I copied the Cyrus folder
with IMAP.pm etc. over to my perl install.

so after I manually moved the modules then i could get cyradm to work. but
the perl scripts trying to access the Cyrus::IMAP modules don't seem to.

Jeff

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Steven M
> Bloomfield
> Sent: Friday, March 08, 2002 8:49 AM
> To: Birger Toedtmann; Jeff Bert
> Cc: [EMAIL PROTECTED]
> Subject: Re: adding users via script
>
>
> here's something really simple i threw together, hope it helps.
>
> #!/usr/local/bin/perl -w
> # Really simple create mailbox script
> # by Steven Bloomfield - [EMAIL PROTECTED]
> #
> # This script only creates a new mailbox, I use MySQL for authentication
> # to execute from command line
> # perl /path/to/adduser.pl username
> # to execute within a PHP script
> # <?exec ("perl /path/to/adduser.pl ".$login);?>
> # I used $login as a variable passed from a form
> # To see this script in action visit http://mail.manchester.com
> # Thanks to david eitzinger for help with authenticating
> pam->mysql database
>
> use Cyrus::IMAP::Admin;
>
> # hostname of IMAP server
> $server = "localhost";
>
> # user and password for cyradm
> $user = "cyrususername";
> $pass = "cyruspassword";
>
> # Authenticate
> my $cyrus = Cyrus::IMAP::Admin->new($server);
> $cyrus->authenticate(-mechanism => 'login', -user => $user, -password =>
> $pass);
> die $cyrus->error if $cyrus->error;
>
> $adduser = $ARGV[0];
> $quota = "2000";
> my $mbox = 'user.' . $adduser;
>
> # Create the account
> print STDERR "Creating $mbox on \n" if $debug;
> $cyrus->createmailbox($mbox);
> warn $cyrus->error if $cyrus->error;
> # Set the quota
> if ($quota)
>  {
>   print STDERR "Setting quota for $mbox to $quota\n" if $debug;
>   $cyrus->setquota($mbox, 'STORAGE', $quota);
>   warn $cyrus->error if $cyrus->error;
>     }
>
>
> ----- Original Message -----
> From: "Birger Toedtmann" <[EMAIL PROTECTED]>
> To: "Jeff Bert" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, March 08, 2002 4:30 PM
> Subject: Re: adding users via script
>
>
> Jeff Bert schrieb am Fri, Mar 08, 2002 at 08:02:44AM -0800:
> > I'm trying to find a script that will allow me to add users via a single
> > command line entry.
> >
> > I found "imapcreate.pl" at sourceforge but it seems to choke on
> every call
> > to the Cyrus::IMAP libraries.
> >
> > Has anyone done something like this or modified this perl
> script to work?
>
> I had this tiny one for testing, maybe you find it useful (but is perl as
> well and uses Cyrus::IMAP, so if they are broken, you're lost)
>
>
> Regards,
>
> Birger
>
>
>
>

Reply via email to