I am migrating one of my servers to virtualmin. I have a scripts that grabs a mail account but its mail file name. On the old server there is only one file to grab. Under virtualmin postfix now puts each new e-mail in its own file. Is threre a place to define this? The old server would store a users mail in one file as the user name. The new one has somenumber.somenumber_0.hostname.com. Any way to change it to creating one file that stores all users mail in one file and stored by the user name?

Status: 
Closed (fixed)

Comments

Howdy -- sounds like you're describing Mbox vs Maildir.

Mbox is one file for all emails, Maildir is one file per email.

Maildir is generally considered the more reliable of the two formats, and is the default that Virtualmin uses.

Would you consider migrating to Maildir?

The Dovecot wiki describes some methods of doing that here:

http://wiki.dovecot.org/Migration/MailFormat

There's also a script out there called imapsync that copies all email from one server to another via IMAP, which would get all your email into Maildir format.

Thanks so much. I dont need to migrate any mail just need to change postfix from the Mbox to Maildir format. Is there an easy way to do that in virtmin? I am only using the mail on this one server to accept one mail box that comes from a system account that gets processed by my code so in this case Maildir works best for my solution.

Postfix does not support mbox but default. I highly suggest not doing this either.

However.....

To specify mbox format, the reader would use home_mailbox = Mailbox

And you need to change dovecot.conf to support mbox instead of maildir.

A google "postfix use mbox format" search came up with http://wiki.centos.org/HowTos/postfix

You can switch to mbox format in Virtualmin, however this will cause problems downloading existing email as you will have to re-configure Dovecot as well to look in the new location. The steps to follow are :

  1. Go to Webmin -> Servers -> Postfix Mail Server -> Local Delivery
  2. Change "Home-relative pathname of user mailbox file" to "None", and make sure "Spool directory" is set to something like "/var/mail" , then click "Save and Apply"
  3. Edit the /etc/procmailrc file and make sure the ORGMAIL and DEFAULT lines are set to /var/mail/$USER
  4. Go to Webmin -> Servers -> Dovecot -> Mail Files, and set "Mail file location" to "Inbox under /var/mail, folders in ~/mail" , then click "Save", and then "Apply Configuration"

All mail should now be delivered to per-user files under /var/mail

Automatically closed -- issue fixed for 2 weeks with no activity.