php and cyrus
Gregory Chagnon
gregchagnon at hotmail.com
Mon Nov 25 20:10:23 EST 2002
Hi-
I tried something like that before, but I get this error:
Warning: Couldn't open stream {192.168.1.200} in
/var/www/html/user/mail2.php on line 7
Any ideas? Thanks all.
-Greg
>From: Veigar Freyr Jökulsson <veigar at tviund.is>
>To: "Gregory Chagnon"
><gregchagnon at hotmail.com>,<info-cyrus at lists.andrew.cmu.edu>
>Subject: Re: php and cyrus
>Date: Tue, 26 Nov 2002 00:40:42 -0000
>
> > Hi-
> > Does anyone know if there is a way to create a cyrus user and mailboxes
> > through php? I've looked around at imap_createmailbox() but am unlcear
>on
> > how to use it. Thanks!!
> > -Greg
> >
>
>You could do something like this, $uid is the login name you want to
>create:
>
> $IMAPhost = "123.123.123.123";
> $IMAPquota = "10240",
> $username = "cyrus";
> $password = "password";
> $imapconn = imap_open("{" . $IMAPhost . "}", "$username",
>"$password",OP_HALFOPEN);
> if ($imapconn) {
> imap_createmailbox($imapconn, "{" . $IMAPhost .
>"}user.".$uid ) or die("can't connect: ".imap_last_error());
> imap_set_quota($imapconn, "user.$uid", $IMAPquota) or
>die("can't connect: ".imap_last_error());
> imap_close($imapconn);
> }
>
>
>--
>Veigar Freyr Jökulsson
>veigar at tviund.is
_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8.
http://join.msn.com/?page=features/junkmail
More information about the Info-cyrus
mailing list