To limit the delivery of incoming messages in PostFix to EuropeanMX servers, please follow the steps below.
Create a file /etc/postfix/access and add the following content:
antispamcloud.com OK
Execute the following command:
postmap /etc/postfix/access
Add the following content to the file /etc/postfix/main.cf
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access, permit_mynetworks, rejectOr
If you have already defined smtpd_client_restrictionsin /etc/postfix/main.cf, add the following at the beginning of your definition and replace permit with reject at the end:
"check_client_access hash:/etc/postfix/access"
Reload the Postfix configuration by executing the following command:
sudo postfix reload
Restart PostFix.
/etc/init.d/postfix restart
You can also set your PostFix so that the delivery of messages is only restricted to certain domains. To do this, follow the steps below.
Add the following content to the file /etc/postfix/main.cf :
smtpd_restriction_classes = EuropeanMX
EuropeanMX = check_client_access hash:/etc/postfix/EuropeanMX, reject
smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/protected_destinations, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
Create the file /etc/postfix/EuropeanMX with the following content:
antispamcloud.com OKIf you also send and receive internal messages, then you must also add the localhost and localdomain to the file in the following format
domain.example OKlocalhost OKlocaldomain OK
Create the file /etc/postfix/protected_destinations and add the domain(s) you want to restrict in the following format:
example.com EuropeanMXexample.net EuropeanMX
Postmap both files.
postmap /etc/postfix/EuropeanMXpostmap /etc/postfix/protected_destinations
Reload the Postfix configuration by executing the following command:
sudo postfix reload
Restart PostFix in order to apply the changes.
/etc/init.d/postfix restart