From: [EMAIL PROTECTED]
Operating system: Redhat Linux 6.2 & above
PHP version: 4.0.4pl1
PHP Bug Type: IMAP related
Bug description: Imap connection silently fails.
This problem is similar to that I submitted in bug # 7816,
however it expands on it.
It appears that the imap_open function fails silently if you
have used any other socket-type function previously in the
script. Specifically I have seen this with calls to
fsockopen, and also the mysql_connect functions. In a
script that I have written I was trying to athenticate the
user before calling the imap_open function, because the
imap_open function takes so long to fail when given an
incorrect username-password pair. Origanally I was trying
to authenticate to a mysql radius database for
authentication, however when the imap function refused to
work with mysql_connect called prior to it, I tried using
fsockopen to connect to the pop3 port on the server so that
I could manually attemp authentication. However this
produced the same results as the mysql attempt.
Specifically I am calling a function for imap_open in the
following manner...
$mbox = imap_open("{my.mail.server:143}" . $mailbox,
$username, $password) || die ("can't connect: " .
imap_last_error());
This works fine unless I have call fsockopen or
mysql_connect before this. If you use either of those
functions prior to this statement in the php script however
the imap_open function appears to succeed and a value is
assigned to $mbox, however subsequent calls to imap
functions attempting to use the "imap stream" stored in
$mbox will fail with an error stating that $mbox is not a
valid imap stream.
--
Edit Bug report at: http://bugs.php.net/?id=9488&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]