Bug #14435 Updated: imap_status fails if multiple imap connections made
| From: | sniper@php.net | Date: | Wed, 12 Dec 2001 16:25:56 +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-73339@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: Feedback
Bug Type: IMAP related
Operating System: Linux (RH7.2, 2.4.9-7)
PHP Version: 4.1.0
New Comment:
What version of c-client you have compiled PHP with?
Does this work with older PHP versions?
Previous Comments:
------------------------------------------------------------------------
[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