This siteAll blogsLe 17ClémentCCBCuisineLe 3ContactSe connecterS'inscrire
  • All blogs
  • Le 17
  • Clément
  • CCB
  • Cuisine
  • Le 3
  • Contact

  • S'inscrire

Recettes informatiques

  • Page de garde
  • Contact
  • Se connecter
  • « SMS gateway (from mail to sms)
  • Create a Debian install USB key without erasing data (Squeeze 6.0.5) »

Migrate from mbox to MailDir

Posted by mazet on Oct 08 2013 in Systeme, Debian

Modify Postfix configuration in /etc/postfix/main.cf

Shell

home_mailbox = Maildir/

Modify Procmail configuration by adding this line into /etc/procmailrc

Shell

DEFAULT=$HOME/Maildir/

Modify Dovecot configuration in /etc/dovecot/conf.d/10-mail.conf

Shell

mail_location = maildir:~/Maildir:LAYOUT=fs

To convert mailbox from mbox format to Maildir format, get mb2md conversion script from

Shell

wget http://batleth.sapienti-sat.org/projects/mb2md/mb2md-3.20.pl.gz
gunzip mb2md-3.20.pl.gz
cp mb2md-3.20.pl /usr/local/bin/mb2md
chmod +x /usr/local/bin/mb2md

Stop all mail services

Shell

invoke-rc.d mailman stop
invoke-rc.d postfix stop
invoke-rc.d dovecot stop

Then execute following commands:

Shell

cd /var/mail
for user in *; do
    id $user >&/dev/null || continue
    echo "Processing $user"
    su - $user << EOF
cd ~$user
mb2md -s mail -R
mb2md -m -s /var/mail/$user
mv mail mail.old
cd Maildir
for d in .[a-z]*; do
    mv \$d \$(echo \$d | sed 's/\.//;s/\./\//')
done
EOF
    echo "$user done"
do

Finally, you can restart all mail services

Shell

invoke-rc.d postfix start
invoke-rc.d mailman start
invoke-rc.d dovecot start
This entry was posted by mazet and filed under Systeme, Debian.

No feedback yet

Catégories

  • Toutes
  • Non catégorisé
  • Programmation
    • Awk
    • Bash
    • C
    • C++
    • Javascript
    • LaTeX
    • Perl
    • Tcl/Tk
  • Systeme
    • Android
    • Debian
    • Ubuntu

Contenu

  • Linux Router
  • Creating a network between 2 virtual machines on Windows with Qemu
  • Build a Debian package for pdmenu
  • Extract informations from epub file
  • Connexion PostgreSql / Java par Socket Unix
  • Example of fork and respawn
  • Start SSH daemon on Git portable distribution
  • Create a git mirror
  • Color diff
  • Create on Debian a Minecraft server
  • GIT/HG/SVN on multiple repos simultaneously
  • Convert Comics into CBZ format
  • Random password generator function
  • Convert to camelCase
  • DKIM and SPF
  • Migration from BackupPC 3 (Debian package) to BackupPC 4 (Standalone Installation)
  • Minimal BC for Mingw
  • Diskless Debian cluster
  • Colorize log file
  • Generate certificates with (or without) a certificate authority
Août 2025
Lun Mar Mer Jeu Ven Sam Dim
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
 << <   > >>
  • Accueil
  • Récemment
  • Archives
  • Catégories
  • Derniers commentaires

Rechercher

Flux XML

  • RSS 2.0: Posts
  • Atom: Posts
What is RSS?

©2025 by Laurent Mazet • Contact • Aide • Open-Source CMS

Complete website engine

Cookies are required to enable core site functionality.