atom feed4 messages in ru.sysoev.nginxnginx imap proxy issue with imap
FromSent OnAttachments
David FarrarNov 12, 2008 9:54 am 
Maxim DouninNov 12, 2008 10:39 am 
David FarrarNov 12, 2008 1:48 pm 
Maxim DouninNov 12, 2008 4:47 pm 
Subject:nginx imap proxy issue with imap
From:David Farrar (davi@exa-networks.co.uk)
Date:Nov 12, 2008 9:54:20 am
List:ru.sysoev.nginx

Hello,

We're using nginx to proxy imap connections across a number of backends. All was fine until we introduced a new backend server running dovecot and discovered that we were (apparently) randomly seeing an 'internal server error' while trying to authenticate.

The trigger for this problem seems to be dovecot sometimes returning the string: "* OK Waiting for authentication process to respond.." before responding "+ OK" to the login command.

Section 2.2.1 of rfc3501 states

""" It is also possible for the server to send a completion response for some other command (if multiple commands are in progress), or untagged data. In either case, the command continuation request is still pending; the client takes the appropriate action for the response, and reads another response from the server. """

so it looks like nginx is incorrectly terminating the connection because it read data that it didn't expect.

Has anybody else come across a similar situation and found a way to resolve the problem?

I guess that it should be fairly trivial to just read and ignore lines from the server until we find a line starting with the expected tag. I'm not too familiar with nginx however so I'd be very happy if anyone has a better fix to suggest before I look into doing that :D