From: thomas at xenocast dot com
Operating system: Windows 2000
PHP version: 4.3.2
PHP Bug Type: IMAP related
Bug description: imap_open will not timeout
Description:
------------
This is a difficult situation to reproduce. I will try
to give you the history. We are running iMail 7.x and
the back-end is through an SQL server. there is a bug
in iMail that if the SQL Server for any reason is
'lost' then POP3 will just hang and not attempt to
reconnect. The only way around it is to restart the
service. This doesn't happen often on our system and
it's quite random, but when it happens nobody can get
their e-mail. The solution I came up with is a script
(referenced below) to check on if I can login to POP3.
If I cannot, restart the service.
The problem arises when this situation happens with
iMail, the imap_open command simply hangs there. It is
waiting for a response from the server after giving the
username and/or password. and nothing comes. It hangs
just like the e-mail clients do, howevver imap_open
FAILS to timeout. At last count the longest the script
hung there without going anywhere was 30 minutes. and I
do not even have set a script time-out so in the least
the script should have failed itself due to running too
long. the function is just sitting there waiting for a
response from the server.
Perhaps there's another way to do this or perhaps there
is a bug in imap_open that doesn't provide for the
thing to timeout or something, wdyt?
Reproduce code:
---------------
$mbox = imap_open("{mail.neweve.com:110/pop3/notls}INBOX", "thomas",
"theduke");
if (!$mbox) {
system("net stop pop3d32");
system("net start pop3d32");
}
Expected result:
----------------
Expected is that imap_open would fail with a timeout or
something and $mbox would be false so my system would
restart.
Actual result:
--------------
Actual result is that imap_open sits there and does
nothing it never stops the script just hangs
indefinitely. When adding "echo" statements as debug
code I see it never passes that line.
--
Edit bug report at http://bugs.php.net/?id=24161&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24161&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24161&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24161&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24161&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24161&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24161&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24161&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24161&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24161&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24161&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24161&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24161&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24161&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24161&r=gnused