I would like to setup postfix to catch all emails from both: domain.tld & [randomsubdomain].domain.tld.
/((\w[\w\-]*)\.)+domain\.tld/ OK
This rule works very good, but unfortunately it's catching only mails for [randomsubdomain].domain.tld
. Any mail to domain.tld
is blocked with below error:
NOQUEUE: reject: RCPT from mail-xx[209.xx]: 554 5.7.1 <test@domain.tld>: Relay access denied;
/home/admin/postfix/virtual_domains
:
/((\w[\w\-]*)\.)+domain\.tld/ OK
/etc/postfix/main.cf
:
virtual_mailbox_domains = pcre:/home/admin/postfix/virtual_domains
virtual_alias_maps = pcre:/home/admin/postfix/virtual_aliases
/home/admin/postfix/virtual_aliases
:
/@((\w[\w\-]*)\.)+domain\.tld/ mailuser
Any ideas how can I solve it ?