I have an email server running (Postfix and Dovecot). I also have an archive of a bunch of raw email files that look like this:
1492038516.M77184P7110.mail2.mysite.com,S=39609,W=40258:2,Sab
I would've used imapsync to get these onto the mail server, but they're already archived on my Mac. So I copied about 1500 of these files directly into /var/vmail/domain/user/.Sent/cur
on my mail server, however, things look a bit odd in RoundCube:
Just dozens of pages of a single (no subject) message.
Is there some way to force Dovecot to properly reindex everything? Because something is definitely wrong here, but I have no idea how to fix it. Or if there's a better way to import raw email files, I'd love to hear it.
Usually, Dovecot is very good at recognizing broken mailboxes and fixes issue on its own. Anyway,
doveadm force-resync
can be used to reindex in this very case.Anyway, you should rather use
doveadm import
to copy those mails back into Dovecot instead of directly fiddling with Dovecot's mailbox folders, even if using MailDir: it will prevent wrong indexes from the beginning.