imap_open retries 3 times on failed auth
| Bug #39362 | imap_open retries 3 times on failed auth | ||||
|---|---|---|---|---|---|
| Submitted: | 2006-11-03 15:47 UTC | Modified: | 2006-11-05 18:32 UTC | ||
| From: | askalski at gmail dot com | Assigned: | iliaa (profile) | ||
| Status: | Closed | Package: | IMAP related | ||
| PHP Version: | 5CVS-2006-11-03 (snap) | OS: | Linux | ||
| Private report: | No | CVE-ID: | None | ||
[2006-11-03 15:47 UTC] askalski at gmail dot com
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
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-11-03 20:03 UTC] iliaa@php.net
[2006-11-03 20:48 UTC] askalski at gmail dot com
[2006-11-04 19:11 UTC] iliaa@php.net
[2006-11-05 03:13 UTC] askalski at gmail dot com
[2006-11-05 18:32 UTC] iliaa@php.net