Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richardsonlima/83d2e533f5b2aa91156324c62da0ef9b to your computer and use it in GitHub Desktop.
Save richardsonlima/83d2e533f5b2aa91156324c62da0ef9b to your computer and use it in GitHub Desktop.
Postfix mbox to Maildir format conversion
Often by default, postfix is configured to deliver email messages in mbox format. To convert mbox to Maildir
1. Edit /etc/postfix/main.cf and look for a line
# "Maildir/" for qmail-style delivery (the / is required).
home_mailbox = Maildir/
2. if procmail is used by postfix to deliver locally change /etc/procmailrc add a line
DEFAULT=$HOME/Maildir/
3. restart postfix
4. for new users to have Maildir/ after creation do
mkdir -p /etc/skel/Maildir/new
mkdir -p /etc/skel/Maildir/cur
mkdir -p /etc/skel/Maildir/tmp
5. convert all existing users to Maildir format using an effect perl script from qmail.org download it at http://www.qmail.org/convert-and-create
wget -c http://www.qmail.org/convert-and-create
then run it
sh convert-and-create
Note: for dovecot no need to change anything, it will autodetect mail box formats, very cool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment