I'm seeing some similar problems, sometimes, but not always, resulting in a backtrace -- recently migrated (where we had POP3 access via an old version of Courier, and IMAP via an older version of Dovecot; rebuilt the indices for POP3 users using the script). A few cases, where it looks like Dovecot doesn't like the size in the dovecot-uidlist written by the conversion script. Even though I could imagine that process not working properly
We also had a problem with the auth process on the atrpms 2.2.10 RPM dying / respawning if a user didn't exist in LDAP (quickly built 2.2.13).
Clearing the cache only doesn't seem to fix the problem; I can fix by removing dovecot-uidlist entirely and letting it rebuild, but all of the users with problems use both IMAP and POP3, so having the UIDLs reset is not ideal.
Sep 6 16:29:30 hostname dovecot: imap(XXXXXXXX): Error: Raw backtrace: /usr/lib64/dovecot/libdovecot.so.0() [0x3dd1a69b9a] -> /usr/lib64/dovecot/libdovecot.so.0() [0x3dd1a69c06] -> /usr/lib64/dovecot/libdovecot.so.0() [0x3dd1a22a8a] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x418d69] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x40d863] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x41709d] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x416150] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x41624a] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x4164bd] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x41682f] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_call_io+0x4e) [0x3dd1a7a2ee] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xa7) [0x3dd1a7b497] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_handler_run+0x9) [0x3dd1a7a379] -> /usr/lib64/dovecot/libdovecot.so.0(io_loop_run+0x38) [0x3dd1a7a3f8] -> /usr/lib64/dovecot/libdovecot.so.0(master_service_run+0x13) [0x3dd1a275d3] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x420088] -> /lib64/libc.so.6(__libc_start_main+0xfd) [0x33b8a1ed5d] -> dovecot-main/imap XXXXXXXX XX.XX.XX.XX UID FETCH UID FETCH UID FETCH UID FETCH [0x40ac69] Sep 6 16:31:28 hostname dovecot: imap(XXXXXXXX): Error: read(/var/spool/maildir/l/XXXXXXXX/cur/1409757870.31894_0.hostname.example.com:2,S): FETCH BODY[] for mailbox INBOX UID 778 got too little data: 763 vs 764 Sep 6 16:31:28 hostname dovecot: imap(XXXXXXXX): Error: Corrupted index cache file /mnt/post/cache/l/XXXXXXXX/.INBOX/dovecot.index.cache: Broken virtual size for mail UID 778 Sep 6 16:44:57 hostname dovecot: imap(XXXXXXXX): Error: read(/var/spool/maildir/l/XXXXXXXX/cur/1407825903.29027_0.hostname.example.com:2,aeS): FETCH BODY[] for mailbox INBOX UID 770 got too little data: 1253 vs 1274 Sep 6 16:44:57 hostname dovecot: imap(XXXXXXXX): Error: Corrupted index cache file /mnt/post/cache/l/XXXXXXXX/.INBOX/dovecot.index.cache: Broken virtual size for mail UID 770