Welcome! Log In Create A New Profile

Advanced

Re: imap proxy and untagged commands

Maxim Dounin
March 13, 2013 10:50AM
Hello!

First of all, thank you for Dovecot!

On Wed, Mar 13, 2013 at 03:53:16PM +0200, Timo Sirainen wrote:

> Hi,
>
> I noticed that the IMAP proxying code currently doesn't ignore extra
> untagged replies from the backend server. For example this would be a
> valid session:
>
> S: * OK Server ready
> S: * NO We're having some load issues
> C: a login {4}
> S: * OK foo
> S: + OK
> S: * OK bar
> C: user pass
> S: * OK almost done
> S: a OK logged in
>
> In real world Dovecot can already send some extra untagged replies if
> there is some trouble (e.g. heavy load) with its authentication process.
> What happens is:
>
> S: * OK Waiting for authentication process to respond..
> C: a LOGIN {3}
> S: * OK Waiting for authentication process to respond..
>
> and nginx fails:
>
> 2013/03/13 15:38:55 [error] 7257#0: *15 upstream sent invalid response:
> "* OK Waiting for authentication process to respond.." while reading
> response from upstream, client: 127.0.0.1, server: 0.0.0.0:10143, login:
> "tss", upstream: 127.0.0.1:143
>
> I attempted to fix this, but it looks like the current code doesn't make
> this very easy. Especially since it seems to be handling data one "read
> block" at a time, which can contain multiple lines, each of which should
> be handled separately (the untagged and non-untagged replies may arrive
> in the same IP packet).

Yes, thanks, it's a known issue - untagged responses are not
handled properly (and there is a similar issue with SMTP multiline
replies, quick and dirty patch at [1]). This isn't considered as
a major problem since nginx is expected to work with controlled
IMAP backends, and it's usually trivial to avoid such untagged
responses. It would be good to fix it though.

[1] http://mailman.nginx.org/pipermail/nginx/2010-August/021785.html

--
Maxim Dounin
http://nginx.org/en/donation.html

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

imap proxy and untagged commands

Timo Sirainen 884 March 13, 2013 09:54AM

Re: imap proxy and untagged commands

Maxim Dounin 381 March 13, 2013 10:50AM

Re: imap proxy and untagged commands

Timo Sirainen 497 March 14, 2013 12:28PM

Re: imap proxy and untagged commands

Maxim Dounin 1031 March 15, 2013 08:52AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready