Android 6 IMAP protocol error (logs included)?

A

AC Question

When K9 mail, Mailwise or Gmail connects to my IMAP server the most recent messages are not displayed. The reason can be seen in the below log (from the server).

This is my interpretation, but I'm no IMAP expert.
Note the four marked (with !!!!) lines: In the first of these the server says that there are 112 messages. In the second it says that the next message is predicted to have UID 272, so the most recent UID should be 271. In the third one K9 asks which messages between UID 63 and 112 are not deleted. In the third line K9 asks for these messages. All messages in the UID range 113 to 271 are omitted, which is obviously wrong. K9 treats the number of existing messages as the greatest UID.

Thunderbird on my laptop bypasses the problem (see second log below) by asking for all messages to be fetched. Notable there is that the largest UID is 271.

Setting the "local folder size" (translation) of K9 to "all messages", as opposed to the default 25, does not remedy the problem.

Gmail does not display all messages in the inbox. When refreshing it does the same as the other apps for the same reason. When opening Settings->Accounts and manually synching, it first synchs messages up to UID = #existing mails (as usual) and then specifically fetches messages "SINCE 2019-04-21" (= yesterday).

Since the problem didn't arise until Android 6, and then for all apps, could it be that the apps use a common IMAP protocol stack (provided by Android 6)?
If so, is the problem with the mail apps, Android or my server (or me)?

I have a Sony Xperia Z5 running Android 6.0 and K9 5.010. I didn't have this problem before updating to Marshmallow.

Greatful for any help.
Joa

2016-04-21 08:21:39,429 - - [ 690] ************** New Connection from: x.x.x.x**************
2016-04-21 08:21:39,430 - - [ 690] S <-- * OK Synametrics IMAP4rev1 server ready 4/21/16 8:21 AM
2016-04-21 08:21:39,546 - - [ 690] C --> 1 CAPABILITY
2016-04-21 08:21:39,547 - - [ 690] S <-- * CAPABILITY IMAP4rev1 IDLE
2016-04-21 08:21:39,547 - - [ 690] S <-- 1 OK CAPABILITY completed
2016-04-21 08:21:39,550 - - [ 690] C --> 2 LOGIN "x@x.x" xxxxxx
2016-04-21 08:21:39,550 - - [ 690] S <-- 2 OK LOGIN completed
2016-04-21 08:21:39,554 - - [ 690] C --> 3 SELECT "INBOX"
2016-04-21 08:21:39,605 - - [ 690] S <-- * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)

!!!!2016-04-21 08:21:39,605 - - [ 690] S <-- * 112 EXISTS!!!!

2016-04-21 08:21:39,605 - - [ 690] S <-- * OK [UIDVALIDITY 14] UID validity status

!!!!2016-04-21 08:21:39,605 - - [ 690] S <-- * OK [UIDNEXT 272] Predicted next UID!!!!

2016-04-21 08:21:39,605 - - [ 690] S <-- * 0 RECENT
2016-04-21 08:21:39,605 - - [ 690] S <-- * OK [PERMENENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
2016-04-21 08:21:39,605 - - [ 690] S <-- 3 OK [READ-WRITE] SELECT completed

!!!!2016-04-21 08:21:39,647 - - [ 690] C --> 4 UID SEARCH 63:112 NOT DELETED!!!!

2016-04-21 08:21:39,649 - - [ 690] S <-- * SEARCH 64 65 66 67 69 81 85 92 93 94 95 96 97 98 101 102
2016-04-21 08:21:39,649 - - [ 690] S <-- 4 OK SEARCH completed

!!!!2016-04-21 08:21:39,718 - - [ 690] C --> 5 UID FETCH 102,101,98,97,96,95,94,93,92,85,81,69,67,66,65,64 (UID FLAGS)!!!!

2016-04-21 08:21:39,720 - - [ 690] S <-- * 102 FETCH (UID 102 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 101 FETCH (UID 101 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 98 FETCH (UID 98 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 97 FETCH (UID 97 FLAGS (\Seen \Answered))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 96 FETCH (UID 96 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 95 FETCH (UID 95 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 94 FETCH (UID 94 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 93 FETCH (UID 93 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 92 FETCH (UID 92 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 85 FETCH (UID 85 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 81 FETCH (UID 81 FLAGS (\Seen \Answered))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 69 FETCH (UID 69 FLAGS (\Seen))
2016-04-21 08:21:39,720 - - [ 690] S <-- * 67 FETCH (UID 67 FLAGS (\Seen))
2016-04-21 08:21:39,721 - - [ 690] S <-- * 66 FETCH (UID 66 FLAGS (\Seen))
2016-04-21 08:21:39,721 - - [ 690] S <-- * 65 FETCH (UID 65 FLAGS (\Seen))
2016-04-21 08:21:39,721 - - [ 690] S <-- * 64 FETCH (UID 64 FLAGS (\Seen))
2016-04-21 08:21:39,721 - - [ 690] S <-- 5 OK UID FETCH completed

Tbird log:
2016-04-21 08:20:40,431 - - [ 688] ************** New Connection from: x.x.x.x**************
2016-04-21 08:20:40,431 - - [ 688] S <-- * OK Synametrics IMAP4rev1 server ready 4/21/16 8:20 AM
2016-04-21 08:20:40,494 - - [ 688] C --> 1 capability
2016-04-21 08:20:40,494 - - [ 688] S <-- * CAPABILITY IMAP4rev1 IDLE
2016-04-21 08:20:40,494 - - [ 688] S <-- 1 OK CAPABILITY completed
2016-04-21 08:20:40,500 - - [ 688] C --> 3 login "x@x.x" xxxxxx
2016-04-21 08:20:40,500 - - [ 688] S <-- 3 OK LOGIN completed
2016-04-21 08:20:40,511 - - [ 688] C --> 4 select "INBOX"
2016-04-21 08:20:40,561 - - [ 688] S <-- * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
2016-04-21 08:20:40,561 - - [ 688] S <-- * 112 EXISTS
2016-04-21 08:20:40,561 - - [ 688] S <-- * OK [UIDVALIDITY 14] UID validity status
2016-04-21 08:20:40,561 - - [ 688] S <-- * OK [UIDNEXT 272] Predicted next UID
2016-04-21 08:20:40,561 - - [ 688] S <-- * 0 RECENT
2016-04-21 08:20:40,561 - - [ 688] S <-- * OK [PERMENENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)]
2016-04-21 08:20:40,561 - - [ 688] S <-- 4 OK [READ-WRITE] SELECT completed
2016-04-21 08:20:40,621 - - [ 688] C --> 5 UID fetch 1:* (FLAGS)
2016-04-21 08:20:40,629 - - [ 688] S <-- * 1 FETCH (UID 1 FLAGS (\Seen))
2016-04-21 08:20:40,629 - - [ 688] S <-- * 2 FETCH (UID 2 FLAGS (\Seen))
2016-04-21 08:20:40,629 - - [ 688] S <-- * 3 FETCH (UID 3 FLAGS (\Seen))
2016-04-21 08:20:40,629 - - [ 688] S <-- * 4 FETCH (UID 4 FLAGS (\Seen))
2016-04-21 08:20:40,630 - - [ 688] S <-- * 5 FETCH (UID 5 FLAGS (\Seen))
2016-04-21 08:20:40,630 - - [ 688] S <-- * 6 FETCH (UID 6 FLAGS (\Seen))

more fetching...

2016-04-21 08:20:40,636 - - [ 688] S <-- * 109 FETCH (UID 268 FLAGS ())
2016-04-21 08:20:40,636 - - [ 688] S <-- * 110 FETCH (UID 269 FLAGS ())
2016-04-21 08:20:40,636 - - [ 688] S <-- * 111 FETCH (UID 270 FLAGS ())
2016-04-21 08:20:40,636 - - [ 688] S <-- * 112 FETCH (UID 271 FLAGS ())
2016-04-21 08:20:40,636 - - [ 688] S <-- 5 OK UID FETCH completed
2016-04-21 08:20:40,661 - - [ 688] C --> 6 IDLE
2016-04-21 08:20:40,661 - - [ 688] S <-- + idling
 

zuben el genubi

Well-known member
Jan 24, 2011
218
3
0
Visit site
Don't know if this has any bearing -
I use Aquamail. I was able to set up IMAP for 2 non-Google accounts..

When I tried to put in Gmail as IMAP, it promptly wanted access to scan the other accounts. That permission was denied by me. The 2 non-gmail accounts are doing fine IMAP. I only use them for reminders rather than regular email. That gets done on the computer.

Since you do have Gmail as IMAP check the policies and permissions. You had to have given permission according to my phone on 6.0 or Gmail wouldn't have given you the IMAP, I

MOTO X Pure 6.0 - MM came on the phone.
 

Forum statistics

Threads
943,173
Messages
6,917,633
Members
3,158,861
Latest member
dumpsterrentals38