All the following commands/edits will need to be done as root:
Install mb2md:
aptitude install mb2md
Stop the mail servers:
/etc/init.d/postfix stop
/etc/init.d/dovecot stop
Edt the /etc/posfix/main.cf:
home_mailbox = Maildir/
Edit the /etc/procmailrc (if you are using procmail for local delivery/filtering):
ORGMAIL=$HOME/Maildir/
MAILDIR=$ORGMAIL
DEFAULT=$ORGMAIL
Edit the /etc/dovecot/dovecot.conf:
mail_location = maildir:~/Maildir
At this point I'd backup the user accounts just in case there is an issue.
Create a bash script with the following and execute it:
for i in $( ls -1 /home ); do
su -l -c 'mb2md -m' $i; ## convert /var/spool/mail/USER
su -l -c 'mb2md -s mail -R' $i;
done
At this point you will need to restart the mail servers:
/etc/init.d/dovecot start
/etc/init.d/postfix start
No comments:
Post a Comment