IMAP doesn't sync correctly - BAD 'Command Error' following APPEND
See original GitHub issueExpected behavior
After setting up an IMAP account in K9 mail I’m having perfect 2-way synchronisation with a Desktop mail client application. Everything I do (read, delete) in either application reflects in the other. I would have expected that it stays this way.
Actual behavior
After using it for some month perfectly this way, suddenly about 2 weeks ago I got syncing errors and they do not go away. Issues observed:
-
When I read a mail in K9, it is marked as such. But after the next sync, it is marked as unread again. Older messages from before the issue (older than 2 weeks when it started happening) stay marked as read (as they should). It seems the ‘read’ mail status is not propagated.
-
When I delete a mail in K9, I do not see it anymore in the list, even after a new sync as expected. But if then goto the Desktop mail client, the deleted messages still appear. It seems the deleted messages in K9 are not deleted from the Server. This used to work perfectly.
Steps to reproduce
For the ‘read mail’ issue:
- Read an unread mail in K9 -> it is marked as such
- Sync mail again -> the mail is marked as unread again
- Steps 1 and 2 can be repeated…
For the ‘delete mail’ issue:
- Delete a mail from K9 -> it is removed from the mail list
- Sync mail again -> it does not re-appear again (good)
- Sync mail in Desktop mail client -> deleted mail still appears
Environment
K-9 Mail version: Latest 5.010
Android version: 6.0.1 on Rooted Samsung GT-N7100
Account type (IMAP, POP3, WebDAV/Exchange): IMAP
Attached Logs
I have attached 5 logs (filtered from logcat using ‘k9’ Regex) in chronological order
- Read Mail.txt -> Read 1 mail on account ‘Henk @ Primestream’
- Sync Mail.txt -> Sync mail directly after that (log might show traces of multiple IMAP account)
- Sync Mail (Warning Level).txt -> Same as above, but filtered for ‘Warning Level’ messages
- Delete Mail.txt -> Delete one mail from account ‘Henk @ Primestream’
- Sync Mail.txt -> Sync mail directly after that
1. Read Mail.txt 2. Sync Mail.txt 3. Sync Mail (Warning Level).txt 4. Delete Mail.txt 5. Sync Mail.txt
Errors I see in logs
Looking at the logs, I see at least the following when Syncing mail:
com.fsck.k9.mail.MessagingException: Could not find UID for message based on Message-ID
Caused by: java.io.IOException: readStringUntil(): end of stream reached
Might it be that the issues start happening when there are too many items in a mail folder: I was experiencing the problems during a holiday, when the number of items in the Inbox folder exceeded a few hundred (now it is around 300). Normally I keep the Inbox ‘clean’ (around 50 messages or so).
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (4 by maintainers)
Top GitHub Comments
For what it is worth: since I originally reported this issue I have not encountered it since. I have switched to Android 7.1 though if that could be of influence…
And to add from the original issuer of this ticket:
Thanks for everybody contributing to K9, great work !