Bug 436748

Summary: Akonadi stops syncing IMAP account with socket timeout or streamparser error
Product: [Frameworks and Libraries] Akonadi Reporter: Kurt Bennater <curdyben>
Component: IMAP resourceAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: major    
Priority: NOR    
Version: 5.17.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Kurt Bennater 2021-05-07 21:48:13 UTC
SUMMARY
After a migration to a new mail server (imap.vodafonemail.de) by my mail provider, Akonadi fails to retrieve all mails from my mail account (e.g., the inbox with 2898 mails shows just 100 mails). Before I removed ~/.local/share/akonadi/, Akonadi reproducably choked on larger mails with (several) attachments which were reproduced over and over.

STEPS TO REPRODUCE
1. In a shell, turn on logging:
$ export QT_LOGGING_RULES="org.kde.pim.* = true"
2. Restart akonadi:
$ akonadictl restart

OBSERVED RESULT
Log output: ...
org.kde.pim.akonadicore: Received batch:  1 Already processed:  39 Expected total amount:  2898
org.kde.pim.akonadicore: Received batch:  1 Already processed:  40 Expected total amount:  2898
org.kde.pim.akonadicore: Received batch:  1 Already processed:  41 Expected total amount:  2898
org.kde.pim.kimap: Socket timeout!
org.kde.pim.kimap: close
org.kde.pim.imapresource: online= false
org.kde.pim.imapresource.trace: RetrieveItemsTask
org.kde.pim.imapresource: Cancelling this request.
org.kde.pim.akonadicore: The item sync is being rolled-back.
org.kde.pim.akonadicore: ItemSync of collection 112 finished due to user cancelling
org.kde.pim.imapresource: online= true
org.kde.pim.imapresource: Fetch job failed  "Connection to server lost."

For some reason, sometimes the error message is "Streamparser error" instead of "Socket timeout", but the result remains the same.

KMail2 pretends that there are only (say) 100 mails in my inbox. Manual syncs don't alter that. This is independent of whether I am using disconnected IMAP or not.

This makes Akonadi in fact unusable for my preferred mail account.

EXPECTED RESULT
Akonadi should sync all mails.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Leap 15.2
(available in About System)
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Possibly the same as reported here: https://bugs.kde.org/show_bug.cgi?id=356751 .