Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have configured a Postfix mail server for two domains: and

In my configuration domain1 has both virtual users with Maildirs and aliases to forward mail to local users (eg. root, webmaster) and some small mailing lists. It also has some virtual mappings to non-local domains.

Domain2 on the other hand has only virtual alias mappings, mainly to corresponding 'users' at domain1 (eg. mails to should be forwarded to

My problem is that currently Postfix accepts mail even for those users that don't exist in the system. Mail to existing users and /etc/aliases works fine. Postfix documentation states that the same domain should never be specified in both mydestination and virtual_mailbox_maps, but If I specify mydestination as blank then postfix validates recipients against virtual_mailbox_maps but rejects mail for local aliases of


myhostname =
mydomain =
mydestinations = $myhostname, localhost.$mydomain, localhost

virtual_mailbox_domains =
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_mailbox_base = /home/vmail/domains

virtual_alias_domains =
virtual_alias_maps = hash:/etc/postfix/virtual

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

virtual_transport = dovecot

/etc/postfix/virtual: right-hand-content-does-not-matter
firstname.lastname user1
[more aliases..] right-hand-content-does-not-matter

/etc/postfix/vmailbox: user1/Maildir user2/Maildir


root: :include:/etc/postfix/aliases/root
webmaster: :include:/etc/postfix/aliases/webmaster

Is this approach correct or is there some other way to configure Postfix with Dovecot (virtual) Maildirs and Postfix aliases?

share|improve this question

Yes, you can't have domain in both mydestination and virtual_mailbox_maps. To overcome this you need set mydestination in

mydestination = localhost.$mydomain, localhost

and in /etc/postfix/virtual   root@localhost  webmaster@localhost

with this setup, email to will be redirected root@localhost. Because localhost listed in mydestination then postfix will apply alias in /etc/aliases

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.