I want to set up a mail server using postfix and dovecot, that stores mail using the maildir format, and I don't want any of these files to go in user's home directories. Wherever I search for how to make postfix use maildir, they just say to set
home_mailbox = Maildir/
but this places mail in the home home directory.
dovecot nicely lets you specify any path, and also gives you %u to customize it, so I set it to
mail_location = maildir:/var/mail/users/%u/:INBOX=/var/mail/users/%u/INBOX
I don't really mind moving the INBOX around, as long as it's not in /home, but I can't find any way to do this. I don't want to bother with virtual users, or procmail, or anything.
Since you've already configured Dovecot, the easiest solution to your problem is to use deliver from Dovecot as the mail delivery agent (MDA).
This could be done by adding this line to main.cf (paths may vary according to your distribution, on Debian it's
/usr/lib/dovecot/dovecot-lda
):If you got a larger scale installation and want to use virtual users, you've got to setup a service in master.cf accordingly, e.g. like this:
Of course you shouldn't use those without carefully crafting your own configs.
Further information can be investigated here:
http://wiki2.dovecot.org/LDA/Postfix