From:             askalski at gmail dot com
Operating system: Linux
PHP version:      5CVS-2006-11-03 (snap)
PHP Bug Type:     IMAP related
Bug description:  imap_open retries 3 times on failed auth

Description:
------------
imap_open will retry 3 times on bad credentials.  Some IMAP or POP servers
delay on successive bad logins, making a failed imap_open take very long. 
Worse, some servers will lock the user out because of repeated failed
login attempts.

Somewhere during module initialization, this call needs to be made:

mail_parameters(NIL, SET_MAXLOGINTRIALS, (void *) 1);


Reproduce code:
---------------
imap_open("{mailserver/pop}", "user", "badpass");


Expected result:
----------------
It should try logging in only once.


Actual result:
--------------
It tries logging in three times (watch with a packet sniffer or strace).

write(0, "AUTH LOGIN\r\n", 12)          = 12
...
read(0, "-ERR Bad authentication\r\n", 8192) = 25
write(0, "AUTH LOGIN\r\n", 12)          = 12
...
read(0, "-ERR Bad authentication\r\n", 8192) = 25
write(0, "AUTH LOGIN\r\n", 12)          = 12
...
read(0, "-ERR Bad authentication\r\n", 8192) = 25
write(0, "QUIT\r\n", 6)                 = 6
read(0, "+OK Sayonara\r\n", 8192)       = 14
write(1, "\nWarning: imap_open(): Couldn\'t "..., 104) = 104


-- 
Edit bug report at http://bugs.php.net/?id=39362&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39362&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39362&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39362&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39362&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39362&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39362&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39362&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39362&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39362&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39362&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39362&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39362&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39362&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39362&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39362&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39362&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39362&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39362&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39362&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39362&r=mysqlcfg

Reply via email to