[Dovecot] Failed proxy auth drops connection for IMAP/POP3 proxy in 1.0-RC15
Hello,
I was seeing an odd behavior in a proxy-only configuration of dovecot. When a user entered an incorrect password in either IMAP or POP3, the Dovecot connection would be immediately dropped, sometimes with the auth failure message, sometimes without (a timing issue).
I believe I have tracked down the cause to the code commented out in the attached diff. It appears that the proxy handlers are giving the client the go-ahead to attempt authorization again and then dismantling the proxy session. I believe the correct behavior would be to allow LOGOUT or QUIT to end the session and do the tear-down in client_destroy. The commented code all gets executed (with more error checking) in client_destroy, so there shouldn't be any memory leaks that I can see.
Please advise if this seems correct or let me know of a different method of fixing. Thunderbird does 'Bad Things (tm)' when the connection is dropped without an authorization failed message... It doesn't re-prompt for the password and the user appears to have correctly authenticated, but the session just sits and no mail can be retrieved.
Thanks,
Bruce
Bruce M. Walter Senior Network Manager Rho, Inc 6330 Quadrangle Drive Suite 500 Chapel Hill, NC 27517 T: 919.408.8000 x332 F: 919.408.0999
Ahh, the joys of Friday... Diff now attached. - Bruce Bruce Walter wrote:
Hello,
I was seeing an odd behavior in a proxy-only configuration of dovecot. When a user entered an incorrect password in either IMAP or POP3, the Dovecot connection would be immediately dropped, sometimes with the auth failure message, sometimes without (a timing issue).
I believe I have tracked down the cause to the code commented out in the attached diff. It appears that the proxy handlers are giving the client the go-ahead to attempt authorization again and then dismantling the proxy session. I believe the correct behavior would be to allow LOGOUT or QUIT to end the session and do the tear-down in client_destroy. The commented code all gets executed (with more error checking) in client_destroy, so there shouldn't be any memory leaks that I can see.
Please advise if this seems correct or let me know of a different method of fixing. Thunderbird does 'Bad Things (tm)' when the connection is dropped without an authorization failed message... It doesn't re-prompt for the password and the user appears to have correctly authenticated, but the session just sits and no mail can be retrieved.
Thanks,
- Bruce
-- __________________________ Bruce M. Walter Senior Network Manager Rho, Inc 6330 Quadrangle Drive Suite 500 Chapel Hill, NC 27517 T: 919.408.8000 x332 F: 919.408.0999 --- src/imap-login/imap-proxy.c.orig Tue Nov 7 10:13:55 2006 +++ src/imap-login/imap-proxy.c Fri Jan 5 11:29:31 2007 @@ -70,12 +70,19 @@ client->io = io_add(client->common.fd, IO_READ, client_input, client); +/* + * [BMW] This appears to cause the connection to drop on an incorrect password. + * + login_proxy_free(client->proxy); client->proxy = NULL; i_free(client->proxy_user); client->proxy_user = NULL; client_unref(client); + +*/ + return -1; } else { /* probably some untagged reply */ --- src/pop3-login/pop3-proxy.c.orig Tue Nov 7 10:17:14 2006 +++ src/pop3-login/pop3-proxy.c Fri Jan 5 11:29:53 2007 @@ -120,6 +120,10 @@ client->io = io_add(client->common.fd, IO_READ, client_input, client); +/* + * [BMW] This appears to cause the connection to drop on an incorrect password. + * + login_proxy_free(client->proxy); client->proxy = NULL; @@ -134,6 +138,7 @@ client->proxy_user = NULL; client_unref(client); +*/ } int pop3_proxy_new(struct pop3_client *client, const char *host,
On 5.1.2007, at 18.50, Bruce Walter wrote:
i_free(client->proxy_user); client->proxy_user = NULL; client_unref(client);
Looks like I've touched this part of the code in rc16:
* src/: imap-login/imap-proxy.c, pop3-login/pop3-proxy.c: Fixed
crash with proxying.
Maybe that also fixes your problem?
participants (2)
-
Bruce Walter
-
Timo Sirainen