Add a domain to postfix configuration – temporary solution src
1
|
|
Now local users receive mails from all domans, i.e. user malpka
will receive mails from malpka@example.org
, malpka@example.com
and malpka@example.net
.
Mails are saved in /var/mail/malpka
Separate mail from UNIX-accounts
Add vmail directory and vmail user
1 2 3 4 5 |
|
Reconfigure postfix to use virtual
Let’s add a mail subdomain
1
|
|
Postfix reconfiguration
1 2 3 4 5 6 7 |
|
virtual_mailbox_domains
– comma separated list of domains that are handled by postfix’ virtual domains mechanism. The rest (frommydestination
) is handled as a local mail.virtual_mailbox_base
– base folder for virtual mailboxes. This is the prefix that is prepended to the items fromvirtual_mailbox_maps
virtual_mailbox_maps
– location of mailboxes for accountsvirtual_minimum_uid
– safety reasonsvirtual_uid_maps
,virtual_gid_maps
– user/group for writing
Domain listed in virtual_mailbox_domains
must not be present in mydestination
Mailbox maps
1 2 |
|
If you would like to use Maildir format instead of MBox, just add slash (example.org/malpka/)
Aliases
1
|
|
Hash configuration files
1 2 |
|
Create mailbox file and setup permission again.
1 2 3 4 5 |
|
Reload postfix configuration
1
|
|
Test
Receive mail.
1
|
|
Remarks
- Despite every email address has it’s own place (different MBox/Maildir) you can only access it from the local system (root or vmail user). Fix in Part 4 – dovecot.
- the mails that you send from a local accounts will still be from
$myorigin
domain - MBox vs Maildir war
- postfix virtual_* configuration can be moved to a database, when needed (more users)