Question
I use GMS IMAP with a number of mail clients including Outlook Express, Eudora and Microsoft Outlook.
For some time I have noticed an intermittent error that only occurs when operating on one of the two Microsoft clients… "Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity"
What is causing this and how can it be avoided?
Answer
This appears to be the fault of the mail client, and the problem has been reported to Microsoft.
Below is a log snippet generated by GMS, you can see that the only action taking place is the selection of the "Inbox" folder via Outlook Express.
If you were to return from lunch, or be away from your desk for over thirty minutes this is when you are likely to encounter the error in question.
The penultimate line shows reference to "+ idling" – this is the server indicating to the client that it has accepted the request to move into "IDLE" mode.
The following log extract shows clearly the process involved
IMAP 12:24:17.921 A 06157 1 0003 SELECT "INBOX" IMAP 12:24:17.921 A 06266 1 * 7 EXISTS IMAP 12:24:17.921 A 06266 1 * 0 RECENT IMAP 12:24:17.921 A 06266 1 * OK [UIDVALIDITY 1141168683] UIDs valid IMAP 12:24:17.921 A 06266 1 * FLAGS (Answered Flagged Deleted Seen Draft) IMAP 12:24:17.921 A 06266 1 * OK [PERMANENTFLAGS (Answered Flagged Deleted Seen Draft)] Limited IMAP 12:24:17.921 A 06266 1 0003 OK [READ-WRITE] SELECT completed IMAP 12:24:17.937 P 06483 1 work thread a4 assigned to session IMAP 12:24:17.937 A 06157 1 0004 IDLE IMAP 12:24:17.937 A 06266 1 + idling IMAP 12:24:17.953 P 06483 1 work thread a4 assigned to session IMAP 12:24:17.953 A 06157 1 DONE IMAP 12:24:17.953 A 06266 1 0004 OK IDLE terminated IMAP 12:24:17.968 P 06483 1 work thread a4 assigned to session IMAP 12:24:17.968 A 06157 1 0005 UID FETCH 46:* (BODY.PEEK[HEADER.FIELDS (References X-Ref X-Priority X-MSMail-Priority X-MSOESRec Newsgroups)] ENVELOPE RFC822.SIZE UID FLAGS INTERNALDATE) IMAP 12:24:18.000 A 06266 1 0005 OK UID FETCH completed IMAP 12:24:18.000 P 06483 1 work thread a4 assigned to session IMAP 12:24:18.000 A 06157 1 0006 UID FETCH 1:45 (UID FLAGS) IMAP 12:24:18.000 A 06392 1 * 1 FETCH (UID 39 FLAGS (Seen)) IMAP 12:24:18.000 A 06392 1 * 2 FETCH (UID 40 FLAGS (Seen)) IMAP 12:24:18.000 A 06392 1 * 3 FETCH (UID 41 FLAGS (Seen)) IMAP 12:24:18.000 A 06392 1 * 4 FETCH (UID 42 FLAGS (Seen)) IMAP 12:24:18.015 A 06392 1 * 5 FETCH (UID 43 FLAGS (Seen)) IMAP 12:24:18.015 A 06392 1 * 6 FETCH (UID 44 FLAGS (Seen)) IMAP 12:24:18.015 A 06392 1 * 7 FETCH (UID 45 FLAGS (Seen)) IMAP 12:24:18.046 A 06266 1 0006 OK UID FETCH completed IMAP 12:24:18.046 P 06483 1 work thread a4 assigned to session IMAP 12:24:18.046 A 06157 1 0007 IDLE IMAP 12:24:18.046 A 06266 1 + idling IMAP 12:55:11.312 F 06050 1 Removing session user@gordano.com - It has timed out
Here is the corresponding log file generated by Microsoft Express…
IMAP: 12:24:17 [tx] 0003 SELECT "INBOX" IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] * 7 EXISTS IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] * 0 RECENT IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] * OK [UIDVALIDITY 1141168683] UIDs valid IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] * FLAGS (Answered Flagged Deleted Seen Draft) IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] * OK [PERMANENTFLAGS (Answered Flagged Deleted Seen Draft)] Limited IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] 0003 OK [READ-WRITE] SELECT completed IMAP: 12:24:17 [tx] 0004 IDLE IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] + idling IMAP: 12:24:17 [tx] DONE IMAP: 12:24:17 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:17 [rx] 0004 OK IDLE terminated IMAP: 12:24:17 [tx] 0005 UID FETCH 46:* (BODY.PEEK[HEADER.FIELDS (References X-Ref X-Priority X-MSMail-Priority X-MSOESRec Newsgroups)] ENVELOPE RFC822.SIZE UID FLAGS INTERNALDATE) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] 0005 OK UID FETCH completed IMAP: 12:24:18 [tx] 0006 UID FETCH 1:45 (UID FLAGS) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 1 FETCH (UID 39 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 2 FETCH (UID 40 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 3 FETCH (UID 41 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 4 FETCH (UID 42 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 5 FETCH (UID 43 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 6 FETCH (UID 44 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] * 7 FETCH (UID 45 FLAGS (Seen)) IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] 0006 OK UID FETCH completed IMAP: 12:24:18 [tx] 0007 IDLE IMAP: 12:24:18 [db] OnNotify: asOld = 5, asNew = 5, ae = 3 IMAP: 12:24:18 [rx] + idling IMAP: 12:55:13 [db] Connection to ' closed. IMAP: 12:55:13 [db] OnNotify: asOld = 5, asNew = 0, ae = 5 IMAP: 12:55:13 [db] ERROR: "Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. ", hr=2148322319
In simpler terms and to illustrate the above, the client is required to send the "DONE" request so that the server knows when to move back out of the IDLE mode into normal operative mode. If you now refer to either the GMS or Microsoft log, it is apparent that DONE is never transmitted by the client.
The use of the IDLE command is fully described in RFC 2177.
See Also:
- Does GMS support the IMAP IDLE command?
- Why are IMAP users intermittently unable to purge their mail?
Keywords:imap outlook express idle terminate connection microsoft client