From:             [EMAIL PROTECTED]
Operating system: Linux (RH7.2, 2.4.9-7)
PHP version:      4.1.0
PHP Bug Type:     IMAP related
Bug description:  imap_status fails if multiple imap connections made

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 bug report at: http://bugs.php.net/?id=14435&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to