From 4c2d5b3bb5f3a142cbd0ef95e41a8f807fe691f4 Mon Sep 17 00:00:00 2001 From: Lauri Nurmi Date: Sun, 18 Mar 2018 23:11:17 +0200 Subject: Do not continue autoprobing other protocols after socket error If e.g. fetching with IMAP and --idle fails with a socket error, returning PS_SOCKET, do not try fetching with a different protocol (e.g. POP3). POP3 might have a completely different idea of read and unread messages than IMAP, which causes already seen messages to be re-fetched. --- fetchmail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetchmail.c b/fetchmail.c index 6d9dfb87..a8a2dc29 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1525,7 +1525,7 @@ static int query_host(struct query *ctl) st = query_host(ctl); } while (st == PS_REPOLL); - if (st == PS_SUCCESS || st == PS_NOMAIL || st == PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH || st == PS_DNS) + if (st == PS_SUCCESS || st == PS_NOMAIL || st == PS_SOCKET || st == PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH || st == PS_DNS) break; } ctl->server.protocol = P_AUTO; -- cgit v1.2.3