0

I'm using Dovecot with Maildirs. I want to move a whole bunch of messages between mailboxes. Like, hundreds of thousands of messages. Should I just use my mail client? Should I move the message files manually on the server? Is there another way to get this done without damaging Dovecot's indexes?

John Clements
  • 171
  • 1
  • 7

1 Answers1

2

Based on my understanding of Dovecot, moving files between Maildir directories is likely to be "okay"; Dovecot should be able to rebuild indices as it goes. HOWEVER, there's a much much better way to do it: use the doveadm copy command. Here's an example I just used:

doveadm move Deleted-Messages-2019 mailbox "Deleted Messages" BEFORE 2019-12-31

This moved about 50K messages in about 10 seconds, and presumably did it in a way that allows dovecot to gracefully reindex.

John Clements
  • 171
  • 1
  • 7