imap connection to gmail closes connection

bidwell nginx-forum at nginx.us
Wed Jan 15 15:37:29 UTC 2014


I am running nginx 1.1.19 on an Ubuntu 12.04.4 64but server.

I have nginx configured to enter on port 143 and go out to 127.0.0.1:143
where it goes through stunnel to go to imap.gmail.com:993. If I talk
directly to 127.0.0.1:143 (to stunnel) it works. If I talk to nginx, it
authenticates, logs correct username, target IP and port, gets the
Capability list and registers a successful login to the remote (gmail) imap
server and then closes the connection immediately. The following is a
transcript of the telnet session:

telnet nginx:143
* OK IMAP4 ready
a1 LOGIN user at example.com password
* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN
X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH
a1 OK user at example.com first_name Last_name authenticated (Success)
Connection closed by foreign host.

My nginx error.log shows the following:
*5 upstream sent invalid response: "* CAPABILITY IMAP4rev1 UNSELECT IDLE
NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE
MOVE CONDSTORE ESEARCH
a1 OK test at example.com Test User authenticated (Success)" while reading
response from upstream,...

It appears to not like google's CAPABILITY line. Is it too long? Any
suggestions?

Other connections through nginx/stunnel to exchange work just fine.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,246483,246483#msg-246483



More information about the nginx mailing list