1 min read

Importing a Maildir using Dovecot

I’m looking into using Dovecot as a way to store all my old emails (I have emails going back 20 years would you believe!)

Before I commit to it though, I am testing how easy it is to migrate between servers.

To import the contents of one Maildir into Dovecot, use the following:

doveadm -Dv import maildir:<path> "" all

Where:

  • -Dv means verbose debugging. You don’t need that.
  • maildir:<path> tells Dovecot where to get the emails from, and that they’re in the Maildir format.
  • "" is the root folder that the messages should be imported into. In this case, it’s the actual root, so the folder structure should be identical to the source.
  • all is the search query. In this case, import all of them.