Howto: local mbox mail users to dovecot virtual ones

I'm migrating our personal mail from postfix+qpopper in mbox and local system users, to postfix+dovecot+virtual users. While doing that, I also wanted reorganize some mailing list subscriptions. Yet, all "mbox2md" kinda scripts are based on local to local conversion.

So I wrote a little C program that can present an mbox file (meant to be the ones in /var/mail) to dovecot's deliver program. Prerequisite: you already must have dovecot's deliver setup correctly and it's outside the scope of this howto.

NOTE: addresses extensions are delivered with -m, meaning:
foo+bar@example.com will file into the bar folder for the foo@example.com user.

Steps:
  1. Extract the source tarball
  2. cd mbox2dovecot
  3. make obj; make depend; make
  4. As root, make install
  5. Move the target mbox file to /tmp or rename it to something no mail would be delivered to.
  6. If moving to a different machine, chown it to your ssh user and scp
  7. On the target machine, run mbox2dovecot as per manpage

You may want to start with a small test mailbox and test account, to make sure deliver is configured correctly.
 

Attachments

  • mbox2dovecot.tar.gz
    4.3 KB · Views: 281
Back
Top