The “masquerade_domains” parameter in Postfix determines which domains should be masqueraded or modified in outgoing email addresses.
When Postfix sends an email, it includes the sender’s address in the “From:” header of the message. However, if the sender’s domain is not a fully qualified domain name (FQDN), some email servers may reject the message due to anti-spam policies. To avoid this issue, Postfix can modify the sender’s address by replacing the local domain name with the domain name specified in the “masquerade_domains” parameter.
For example, if your local domain name is “example.local”, and you want to send email to external domains like “example.com” or “example.net”, you can set the “masquerade_domains” parameter to include those domains. When you send an email with a sender address of “user@example.local“, Postfix will modify the address to be “user@example.com” or “user@example.net“, depending on the recipient’s domain.
Here’s an example configuration for “masquerade_domains” in the “main.cf” file:
makefileCopy codemasquerade_domains = example.com, example.net
In this example, any email sent from your server with a sender address containing “example.local” will be modified to use “example.com” or “example.net” instead, depending on the recipient’s domain.
Pingback: Configure Ubuntu 20.04.6 LTS to forward email using Postfix – Festival State IT