Bug #18282 Updated: imap_open return doesn't return FALSE when mailbox doesn't exist
| From: | sniper@php.net | Date: | Fri, 12 Jul 2002 08:32:55 +0000 |
| Subject: | Bug #18282 Updated: imap_open return doesn't return FALSE when mailbox doesn't exist | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-13925@lists.php.net to get a copy of this message | ||
ID: 18282
Updated by: sniper@php.net
Reported By: valerio@dei.unipd.it
-Status: Feedback
+Status: Bogus
Bug Type: IMAP related
Operating System: Linux
PHP Version: 4.2.1
New Comment:
Your 'workaround' really is the correct way to do it..
In your test script, the connection is established,
just the mailbox select fails.
Try add this right after the imap_open() line:
echo imap_last_error();
Previous Comments:
------------------------------------------------------------------------
[2002-07-12 04:22:25] valerio@dei.unipd.it
This script output nothing (I mean _nothing_) when mailbox
with name "this_file_doesnt_exist" isn't there.
<?php
print "BEFORE IMAP_OPEN<br>";
$my_stream=imap_open("{localhost:143}this_file_doesnt_exist","realusername",
"rightpassword",OP_READONLY);
if ($my_stream) {
/* uncomment me if you want to see $my_stream value */
/*print $my_stream; */
$barney=imap_fetchbody($my_stream,1,"1");
print $barney;
imap_close($my_stream);
}
print "AFTER IMAP_OPEN<br>";
?>
My current workaround is a
imap_open("{localhost:143}",...,OP_HALFOPEN), imap_listmailbox and
comparison on all values to check the existence of a particular mailbox
name before opening it.
------------------------------------------------------------------------
[2002-07-11 14:21:35] sniper@php.net
Please give us a short but complete example script
which can be used to reproduce this..
------------------------------------------------------------------------
[2002-07-11 14:12:23] valerio@dei.unipd.it
imap_open($server_strings.$mailbox, $username,$passwd,$options)
should return FALSE when username/password are correct
but mailbox doesn't exist.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18282&edit=1