First you have to tell Postfix to deliver emails to a user's Maildir:
Code:
postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart
Then you have to create a system user and a password:
Code:
useradd -d /home/sample_user -g users sample_user
passwd sample_user
Then run
Code:
postconf -e 'virtual_maps = hash:/etc/postfix/virtusertable'
postconf -e 'mydestination = /etc/postfix/local-host-names'
/etc/postfix/local-host-names should contain all domains that you want to accept emails for, e.g.:
Code:
localhost
your.server.name
localhost.your.server.name
example.com
yourdomain.com
/etc/postfix/virtusertable looks like this:
Code:
info@yourdomain.com sample_user
thomas@example.com sample_user
webmaster@yourdomain.com sample_user
Emails for
info@yourdomain.com,
thomas@example.com and
webmaster@yourdomain.com will now arrive in the mailbox of sample_user.
Everytime you change /etc/postfix/virtusertable you have to run the following command:
Code:
postmap /etc/postfix/virtusertable
Now restart Postfix:
Code:
/etc/init.d/postfix restart
and you're done!