This is an old revision of the document!
You know how it is. Your little mail host has just sat there for a long while, slowly accreting a user here and a user there. They are all full users on the machine, so they have logins and everything, and exim
is configured to deliver their mails to ~/Maildir.
And then some dangerous loon suddenly demands that you add mailboxes for people using a completely different domain. They're not really much to do with you, and certainly shouldn't be full-blown users on your host.
Time, then, to add virtual mailboxes to your poor little mail host.
There all sorts of HOWTOs on doing this, of various ages and usefulness. I'm adding this page to the malestrom just to document the configuration changes I did. Or rather, the configuration changes I ended up with.
I'm illustrating this by setting up a new domain example.mod with user tommy.atkins.
First I created a system user and group vmail
to own all virtual mailboxes.
# adduser -system --home /var/local/vmail --group vmail
and a configuration directory.
# mkdir /etc/vmail
Configuration information for the domain will be under /etc/vmail/<domain
. If that directory doesn't exist, the domain isn't supported.
# mkdir /etc/vmail/example.mod
The general scheme is that we have mailboxes under /var/local/vmail/<domain>/<user>/Maildir
. Why Maildir
? Because our existing users will continue to get mail in ~/Maildir
and it keeps dovecot
config a little simpler.
# mkdir -p /var/local/vmail/example.mod # chown -R vmail:vmail /var/local/vmail