From:             [EMAIL PROTECTED]
Operating system: RH Linux 6.2, Windows NT4
PHP version:      4.0.5
PHP Bug Type:     IMAP related
Bug description:  imap_getmailboxes doesn't work after a database connection

Now, this is a hard one I think, at least to explain:

brief explanation: (full code later)

imap_open + imap_getmailboxes -> works fine alone

Database connection + imap_open + imap_getmailboxes -> generates this error: 

Warning: Unable to find stream pointer in 
/usr/local/apache/htdocs/folder/correo_carpetas.php on line 8 (where imap_getmailboxes 
imap_getmailboxes failed: 
Warning: Unable to find stream pointer in 
/usr/local/apache/htdocs/folder/correo_carpetas.php on line 21 (where imap_close is)

I tried with two database connections: against MSSQL 7.0 and Oracle8i. Just a call to 
mssql_connect or OCIPLogon spoils the whole thing. Comment that line, and all the 
mailboxes will be listed fine.

Full example:


/* fails with Oracle8i + PHP (IIS/Win32 or Apache/Linux) */
/* also fails with mssql_connect under IIS/Win32 */
/* comment the next 3 lines and everything will go ok (it's just like the sample 
provided in PHP manual ! */

$c1 = ociplogon("myuser","mypwd","devunix");

        $mbox = imap_open("{}","user","userpwd",OP_HALFOPEN) || 
die("can't connect: ".imap_last_error());
        $list = imap_getmailboxes($mbox,"{}","*");
        if(is_array($list)) {
          while (list($key, $val) = each($list))
            print "($key) ";
            print imap_utf7_decode($val->name).",";
            print "'".$val->delimiter."',";
            print $val->attributes."<br>\n";
        } else
          print "imap_getmailboxes failed: ".imap_last_error()."\n";


I hope I made myself clear. Ask me whatever you need.


F.J. Ortiz

Edit Bug report at:

PHP Development Mailing List <>
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