How Do I Whitelist Hosts/IP Addresses In Postfix?
If you are not recieving emails from a sender to Postfix, this could be due to issues with the senders SPF record being incomplete, or malformed. If you really need to get emails from the sender one way would be to whitelist the ip or host address of the sender.
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:
To whitelist a ip/host on Postfix create/edit the following file:
Add the ip/host you wish to whitelist, one line at a time:
After you’ve created/modified that file, you must postmap the file with this command:
Next open Postfix config file /etc/postfix/main.cf and search for the smtpd_recipient_restrictions parameter.
Add the following entry after variable reject_unauth_destination, but before the first blacklist.
An example entry:
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_client_access hash:/etc/postfix/rbl_override, check_policy_service unix:private/spfcheck
Last thing to do is restart Postfix using the following command in order for the changes to take effect:
/etc/init.d/postfix restart (Centos/RHEL 6 and Ubuntu)
systemctl restart postfix (Centos / RHEL 7)