If you're running a newly configured Postfix SMTP server and you get in /var/log/maillog errors like:
Relay access denied
i.e. in log whenever you try to deliver a mail to the mail server you get something like:
Jan 29 10:05:04 600h postfix/smtpd[4624]: NOQUEUE: reject: RCPT from mxtb-pws3.mxtoolbox.com[64.20.227.133]: 554 5.7.1 <test@example.com>: Relay access denied; from=<supertool@mxtoolbox.com> to=<test@example.com> proto=ESMTP helo=<please-read-policy.mxtoolbox.com>
This is to because the virtualdomain to which postfix is trying to deliver is not added among the domains for which relaying is allowed.
To fix it edit /etc/postfix/main.cf ; find line
relay_domains = $mydestination
and add all domains, for which relaying should be allowed. Let's say you have virtual domains example.com and example1.com to enable relaying, add to conf:
relay_domains = $mydestination example.com example1.com
Also whether, virtual domain names are read from a separate configured hashed .db file like /etc/postfix/virtual.db
Usually done via /etc/postfix/main.cf via vars:
virtual_mailbox_maps = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
Its necessery to run cmd;
postmap virtual
# ls -al /etc/postfix/virtual*
-rwxrwxrwx 1 root wheel 45 Jan 29 05:27 /etc/postfix/virtual
-rwxrwxrwx 1 root wheel 131072 Jan 29 10:58 /etc/postfix/virtual.db
This command re-builds virtual.db including all newly input domains in /etc/postfix/virtual
Finally to load new configs its necessary to restart postfix;
This particular Postfix is running on FreeBSD so to restart it;
# /etc/rc.d/postfix restart
....