• Community Support
  • USEnglish
  • How to migrated an external Maildir account into Mailcow?

I have a backup of one of my email accounts in the Maildir format. I made it manually, and it’s not from a Mailcow instance.

How to import it into a Mailcow? Will I also have to create a domain and mailbox for it first?

I’m aware of the 2 import/export bash scripts of Mailcow, however, can they be used in this case?

6 days later

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

I may be wrong with this but I think you can use Thunderbird to do this. I think I did this a while back but don’t remember the exact instructions.
Maybe someone else here can guide you better.

You should create a sync-job in the mailcow-ui, in email -> configuration -> synchronisation.
Sorry, I don’t know the correct wording, I used a german localized version.

@kantamaru267 I think you can just copy the files over to your newly created mailbox directory

The mailboxes are located (in my case) at

/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/

the actual mailbox dir is located at domain/user/Maildir/

Maybe try it first with a test mailbox

    DocFraggle let me try
    have you done it?

    simply copy? or will I have to prepare the domains and mailboxes first by creating them via the UI?

      4 days later

      kantamaru267 yes you have to create the domains and mailboxes before copying the files

      I dind’t try this myself as I migrated from an existing mailserver and used the sync jobs to sync the mailboxes.
      Basically it should be the same as the restore script does while restoring a vmail backup.

      What you have to do after copying the files is to run the “Encrypt /var/vmail” part you can find here: docs.mailcow.email Icon Mail crypt - mailcow: dockerized documentation


      This will encrypt and compress your imported mails afterwards

      Maybe try it first with a simple test mailbox

      If you’re comfortable with the command line, you can look at GitHub Icon rick sanders imap tools

      There’s a maildir to imap script which could do what you want and the tools are pretty easy to use.

      No one is typing