To allow your server to act as a relay for other mail domains, you need to have three different pieces in place.
First you need to tell Postfix that it is responsible for the domain(s). That is normally done in the virtual_mailbox_domains option, for example:
virtual_mailbox_domains=/etc/postfix/virtual_domains.txt
In /etc/postfix/virtual_domains.txt you would list the domains, 1 per line:
example.net
domain.com
Then you need to tell Postfix that the final destination is not the local machine, which is done in the transport table:
example.net smtp:[1.2.3.4]
domain.com smtp:[mail.domain.com]
The transport table can be configured in many ways, reading the documentation is advisable to find the best solution to your situation. The examples I have posted uses [] around the final destination, to exclude MX lookups.
Finally, you will need an MX record for the domain you want to relay for, pointing to your mail server.
Article ID: 104, Created: 4/23/2025 at 3:37 PM, Modified: 4/23/2025 at 3:37 PM