Thunderbird doesn't really do the same thing here. Whether it's because it had never been synchronised before or because their IMAP implementation is poorly optimized I'm not sure. It just fetches all the emails (1:*)
We have received mails already so we start from 63. Clearly we are mistaking the email count for the next valid UID, which is terrible behaviour.
What amazes me is Gmail does the same.
It's possible that to implement IMAP with other mail servers they imported the IMAP code from the original AOSP app. But this should break everywhere, the number of emails will almost never be the next valid UID except if you never move or delete an email.
I will try and check the source code to see if this is what the code actually says we are doing and whether we have fixed it in master.
The only thing that I can think of right now is that both Gmail and we are expecting you to list some capability which you are not. But from the spec I can't see this as being the case.
Any thoughts cketti?
>> *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: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,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
>>
>>
>
>--
>--
>You received this message because you are subscribed to the K-9 Mail
>Users List.
>To post to this group, send email to
k-9-...@googlegroups.com
>To unsubscribe, email
k-9-mail+u...@googlegroups.com
>To report an issue with K-9 Mail, visit
>
http://code.google.com/p/k9mail/issues/list
>For more options, visit this group at
>
http://groups.google.com/group/k-9-mail
>
>---
>You received this message because you are subscribed to the Google
>Groups "K-9 Mail" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to
k-9-mail+u...@googlegroups.com.
>For more options, visit
https://groups.google.com/d/optout.
Best regards,
Philip Whitehouse