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 <[EMAIL PROTECTED]>
To: "Gregory Chagnon" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
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
[EMAIL PROTECTED]

_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail

Reply via email to