2

I need to have postfix store mail in a maildir in /var/mail/<DOMAIN>/<USER>. I've got

mail_spool_directory = /var/mail

and I'm preparing

home_mailbox = 

but I don't know where to go from there.

Assistance please?

EDIT: SF ate my tag. Please re-read to determine paths.

Glen Solsberry
  • 1,536
  • 5
  • 28
  • 38

2 Answers2

3

It sounds like you want Vritual mailbox delivery. This is well-documented at the Postfix website, and will do exactly what you are asking. Note that you will need to do some lookup tables for this, although the official docs do mention that you can use a SQL backend at some point, should it all become too unmanageable.

Avery Payne
  • 14,536
  • 1
  • 51
  • 88
2

The only way I can think of to accomplish what you want is the using Procmail (or alike with similar capabilities) as the delivery agent. With procmail, something like this on the system wide procmailrc would work:

:0
* RECIPIENT ?? .*@\/.*$
{ DOMAIN = "$MATCH" }
MAILDIR="/var/mail/$DOMAIN/$USER"
DEFAULT="$MAILDIR/"