Postfix advice requested

david david at daku.org
Tue Feb 2 22:25:34 UTC 2021


Dear Gurus

I'm having a problem configuring Postfix on Ubuntu server 20.04, to 
perform as follows:

I want to accept mail for several domains, let's say:   d1.tld, 
d2.tld, with 'd1.tld' being 'mydomain'.

Mail for some specific destinations are supposed to be delivered 
locally to designated accounts:
  mail for a at d1.tld goes to local account 'd1_a'
  mail for b at d1.tld goes to local account 'd1_b'
  mail for anyone else at d1.tld goes to 'owner_d1'
  mail for anyone at d2.tld goes to 'owner_d2'


To accomplish this, I set values in /etc/postfix/main.cf:

mydomain	= d1.tld
mydestination	= localhost.$mydomain localhost $mydomain
virtual_alias_domains = d2.tld
virtual_alias_maps = hash:/etc/postfix/virtualusers

The file /etc/aliases contains:
root: owner_d1

and the file /etc/postfix/virtualusers contains:

a at d1.tld	d1_a
b at d1.tld	d1_b
@d1.tld	owner_d1
@d2.tld	owner_d2

All four linux accounts exist.

And my problem is that all mail for anyone d1.tld and d2.tld gets 
delivered to owner_d1.
Can anyone advise me where to look for a solution?

David






More information about the ubuntu-users mailing list