This guide discusses transforming a system from the traditional mbox/mailbox format to the more advanced Maildir format.
I assume you are using the postfix mailer - if not, you will probably want to change over to postfix first or some of this material may not be relevant.
Before commencing, backup your entire system.
You do not want any mail coming in while doing the conversion. You should also stop any programs that automatically generate mail locally.
# /etc/init.d/postfix stop
If you are running Debian, this command will get everything you need:
# apt-get install mb2md
For each user on your system:
# su daniel
$ cd ~
$ mb2md -m
$ mb2md -s mail
$ exit
# mv /var/spool/mail/daniel /var/spool/mail/daniel.preMaildir
# mv ~daniel/mail ~daniel/mail.preMaildir
NOTE: The second Later on, you will want to delete the If you are using the built in delivery agent you should put this into If you are using procmail as your delivery agent, you should put this into If you are using another delivery method, you should refer to the documentation that comes with it.
If you are using LDAP, you may need to put an attribute into each user's entry in the directory. The attribute needs to specify the full path of the Maildir, with a trailling /
If users have their own Wherever a folder name is specified, such as Original If you are using uw-imap to access your mail, you will need to find a new IMAP server. Try cyrus-imap. On Debian, just type:
If you use squirrelmail, you need to make the following changes:
Section (2) "Server Settings", change the IMAP server type to "Cyrus" and make sure that "delimiter" is set to "detect".
Section (3) "Folder Settings", make sure the first option, "Default Folder Prefix" is blank.
You will also need to change the prefs file for each individual user (I hope you know how to use sed, or you could be editing a lot of text files by hand!).
For user You simply need to make sure these values are correct, this is what I use for compatibility with my other IMAP client, Mozilla Thunderbird (package icedove on Debian):
Don't forget this last step, or you won't receive any mail for a few days.
mb2md
command is only needed if the user has a directory
~/mail
where they store mbox/mailbox format mail folders.
.preMaildir
versions to recover disk space. Before you do so, make sure everything is working fine.
Configure postfix
/etc/postfix/main.cf
:
home_mailbox = Maildir/
/etc/postfix/main.cf
(it is all one line):
mailbox_command = /usr/bin/procmail -a "$EXTENSION" DEFAULT=$HOME/Maildir/ MAILDIR=$HOME/Maildir
Configure each
procmailrc
.procmailrc
files, then they need to be updated. This could be time consuming.
/home/daniel/mail/folder1
, it needs to be changed to .folder1/
- you don't need to put the complete filesystem path, just the full stop, a folder name and a trailling slash.
.procmailrc
:
:0
* ^From.*xyz-list@xyz-domain.com
/home/daniel/mail/xzy-list
:0
* ^From.*xyz-list@xyz-domain.com
.xyz-list/
Remove uw-imap, install cyrus-imap
# apt-get install cyrus-imap
Reconfigure squirrelmail
# /etc/squirrelmail/conf.pl
daniel
, the file to change is /var/lib/squirrelmail/data/daniel.prefs
trash_folder=INBOX.Trash
sent_folder=INBOX.Sent
draft_folder=INBOX.Drafts
Start postfix
# /etc/init.d/postfix start