aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2019-05-11 23:51:04 +0200
committerMatthias Andree <matthias.andree@gmx.de>2019-05-12 09:54:26 +0200
commit1e3a3e7e47336ceaee07cc495c728e35f4ac9fc6 (patch)
tree7ffdbbe443cfd67cf69dea1968933ba2691250d9
parent41e20033d08f7ee7422fa2d353ac4daf7495f887 (diff)
downloadfetchmail-1e3a3e7e47336ceaee07cc495c728e35f4ac9fc6.tar.gz
fetchmail-1e3a3e7e47336ceaee07cc495c728e35f4ac9fc6.tar.bz2
fetchmail-1e3a3e7e47336ceaee07cc495c728e35f4ac9fc6.zip
Drop socket when receiving unexpected untagged * BYE.
Reported against 6.3.26 by minorwiping@vfemail.net when polling from imap.yandex.com and it looped on "* BYE Autologout; idle for too long" in response to a A0001 CAPABILITY request.
-rw-r--r--imap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/imap.c b/imap.c
index 7eb3dc42..edad9581 100644
--- a/imap.c
+++ b/imap.c
@@ -72,6 +72,10 @@ static int imap_untagged_response(int sock, const char *buf)
* connection to be cut-off after this */
if (outlevel > O_SILENT)
report(stderr, GT_("Received BYE response from IMAP server: %s\n"), buf + 5);
+ return PS_SOCKET; /* tell caller to not touch the socket any longer.
+ Note this is under stage != STAGE_LOGOUT, so when
+ we are logging out properly, we will complete the
+ protocol exchange. */
}
else if (strstr(buf, " EXISTS"))
{