MBF Knowledge Base

How Do I Whitelist Hosts/IP Addresses In Postfix?

To whitelist a server, create a file, /etc/postfix/rbl_override where you will list all IP addresses or host names (one per line!) that you want to whitelist:

1.2.3.4 OK
1.2.3.5 OK
mail.exampledomain.com OK

After you've created/modified that file, you must run the following command:

postmap /etc/postfix/rbl_override

Next open /etc/postfix/main.cf and search for the smtpd_recipient_restrictions parameter.

Add check_client_access hash:/etc/postfix/rbl_override to that parameter, after reject_unauth_destination, but before the first blacklist.

Lastly, restart Postfix using the following command in order for the changes to take effect:

/etc/init.d/postfix restart