Bug #14435 Updated: imap_status fails if multiple imap connections made

From: Date: Fri, 14 Dec 2001 04:03:15 +0000
Subject: Bug #14435 Updated: imap_status fails if multiple imap connections made
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-73653@lists.php.net to get a copy of this message
ID: 14435 Updated by: sniper Reported By: rdp@talisman.mv.com Old Status: Open Status: Closed Bug Type: IMAP related Operating System: Linux (RH7.2, 2.4.9-7) PHP Version: 4.1.0 New Comment: Closing this then. --Jani Previous Comments: ------------------------------------------------------------------------ [2001-12-13 12:14:12] rdp@talisman.mv.com This looks to be a bug in either imap2000 or RedHat's imap2000 packages. It's fails with both php 4.1.0 and 4.0.6 on RH 7.2 and 7.0. However after updating the 7.2 machine to imap2001 (from rawhide) and recompiling 4.1.0 it all seems to work. Also my Debian unstable machine (with imap2001) seems to be fine as well. Sorry to waste your time. ------------------------------------------------------------------------ [2001-12-12 14:30:10] rdp@talisman.mv.com This is from RedHat 7.2 i386, so the imap version is imap-2000c-15. I also have a debian unstable machine and I'll see if it behaves the same on there. ------------------------------------------------------------------------ [2001-12-12 11:25:56] sniper@php.net What version of c-client you have compiled PHP with? Does this work with older PHP versions? ------------------------------------------------------------------------ [2001-12-11 15:30:29] rdp@talisman.mv.com If I open multiple imap connections to different servers I can not use imap_status on the first server opened, but other imap calls (example: imap_mailboxmsginfo) will work. This seems similar to bug 8424, but involving multiple servers. Code example: <? $conn1 = imap_open("{host1:143}INBOX","user1","password1"); var_dump($conn1); $status1 = imap_status($conn1,"{host1:143}INBOX",SA_ALL); var_dump($status1); $conn2 = imap_open("{host2:143}INBOX","user2","password2"); var_dump($conn2); $status2 = imap_status($conn2,"{host2:143}INBOX",SA_ALL); var_dump($status2); $status1 = imap_status($conn1,"{host1:143}INBOX",SA_ALL); var_dump($status1); $info1 = imap_mailboxmsginfo($conn1); var_dump($info1); imap_close ($conn1); imap_close ($conn2); ?> The results from running this against two different servers (with different user IDs and passwords) are: resource(1) of type (imap) object(stdClass)(6) { ["flags"]=> int(31) ["messages"]=> int(2) ["recent"]=> int(0) ["unseen"]=> int(0) ["uidnext"]=> int(3) ["uidvalidity"]=> int(1008100790) } resource(2) of type (imap) object(stdClass)(6) { ["flags"]=> int(31) ["messages"]=> int(9) ["recent"]=> int(0) ["unseen"]=> int(1) ["uidnext"]=> int(56694) ["uidvalidity"]=> int(407) } bool(false) object(stdClass)(8) { ["Unread"]=> int(0) ["Deleted"]=> int(0) ["Nmsgs"]=> int(2) ["Size"]=> int(4974) ["Date"]=> string(37) "Tue, 11 Dec 2001 15:20:52 -0500 (EST)" ["Driver"]=> string(4) "imap" ["Mailbox"]=> string(49) "{localhost.localdomain:143/imap/user="user"}INBOX" ["Recent"]=> int(0) Note the bool(false) return from the second imap_status call against host1, though I never closed the imap_connection and the imap_mailboxmsginfo call below works fine. I can see errors in the systems logs being generated by this script. It seems that imap_status is getting the host correct but is passing the wrong userid to the imap server. So for example in the above I see errors from imapd on host1 using the username from host2. (FWIW I also seen this behavior with the 4.2.0-dev tree from November 28th, 2001). --rdp ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=14435&edit=1

« previous php.dev (#73653) next »