Configuring Postfix mail forwarding domains is a practical solution for situations where local mailboxes are not available, and the server is not serving as an MX backup. This article guides you through the process of setting up mail forwarding domains, with a focus on forwarding emails to designated destinations. Please note that this guide should not be used if you have relay_domains configured through SQL mapping or virtual mapping.
Setting Up a Mail Forwarding Domain
To establish a mail forwarding domain, let’s take the example of configuring tech-notes.net for mail forwarding. Follow these steps:
/etc/postfix/main.cf file and ensure that the following two lines exist in it:
virtual_alias_domains = tech-notes.net virtual_alias_maps = hash:/etc/postfix/virtual
You can specify more values for
virtual_alias_domains separating them by space.
Save and close the
Run the following command to update the virtual mapping:
Restart the Postfix to apply the change
service postfix reload
By following these steps, you can easily configure Postfix to forward emails to specific destinations or catch-all addresses, depending on your server’s requirements.