php and cyrus
Kendrick Vargas
ken at hudat.com
Tue Nov 26 10:50:12 EST 2002
Can you telnet from the computer running the web server to port 143 on the
server running the imap service? It seems like your web server can't
establish a connection. From your web server, try:
> telnet your.imap.server.com 143
* OK your.imap.server.com Cyrus IMAP4 v2.1.10 server ready
. login yourusername yourpassword
. OK User logged in
. logout
The above is an example session. Yours should look similar. Of course, you
should use the proper address for your server and a correct username and
password. If you can't accomplish the above, then something is broken in
your setup. Until you can get the above working manually, your php scripts
will remain broken because they are essentially doing the same thing.
-peace
On Tue, 26 Nov 2002, Gregory Chagnon wrote:
> Hi again-
> Thanks for all the suggestions, but everything that I've tried results in
> this error, obviously the 2nd and 3rd errors are a result from the 1st one:
>
> Warning: Couldn't open stream {192.168.1.200:143} in
> /var/www/html/user/mail2.php on line 42
>
> Warning: imap_listmailbox(): supplied argument is not a valid imap resource
> in /var/www/html/user/mail2.php on line 55
>
> Warning: imap_createmailbox(): supplied argument is not a valid imap
> resource in /var/www/html/user/mail2.php on line 61
>
>
>
>
>
>
>
> >From: Kendrick Vargas <ken at hudat.com>
> >To: Gregory Chagnon <gregchagnon at hotmail.com>
> >CC: info-cyrus at lists.andrew.cmu.edu
> >Subject: Re: php and cyrus
> >Date: Mon, 25 Nov 2002 21:47:35 -0500 (EST)
> >
> >Here's a small attachment you can use as an include file. You can use it
> >as such from PHP:
> >
> >$server = new IMAP_Server();
> >$server->createMailbox("user.whatever");
> >$server->deleteMailbox("user.whatever");
> >
> >Both functions return true or false on success or failure (respectively).
> >You can edit the file and set the proper variables, or you can pass them
> >in when you create the object.
> > -peace
> >
> >On Mon, 25 Nov 2002, Gregory Chagnon wrote:
> >
> > > 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
> > >
> > >
> >
> >--
> >Let he who is without clue kiss my ass
> ><< IMAP_Classes.inc >>
>
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
>
--
Let he who is without clue kiss my ass
More information about the Info-cyrus
mailing list