Plesk

Incoming mail to Plesk server is rejected by Spamhaus BL: Error: open resolver

Symptoms

Cause

Email messages are rejected due to the fact that Spamhaus stopped supporting public DNS resolvers and Plesk server is configured to use them. For more information on a change in Spamhaus policy, please refer here.

Resolution

There are several ways of solving:

  1. Disable DNSBL queries on Plesk server by unchecking the Turn on spam protection based on DNS blackhole lists checkbox at Tools & Settings > Mail Server Settings.
  2. Configure Plesk server to use a non-public DNS resolver. To use a private DNS resolver, you would have to:

    1. Set up an on-premise DNS server, or utilize a private DNS resolver service such as Azure DNS Private Resolver.
    2./etc/resolv.conf would then have to be edited to point the server to the new DNS resolver's IP using the format:

    nameserver 192.0.2.2

  3. Configure Plesk server to use a different DNSBL service that does not forces us to access it via non-public DNS resolvers: dnsbl.info; spamcop.net; spam.abuse.net
  4. Switch to using Spamhaus DQS (Data Query Service) as a way to access the DNSBL service. The drawback of this approach is that it requires you to contact Spamhaus to get an access key. More information can be found here.
  5. Edit the /etc/postfix/main.cf configuration file as described below to introduce exclusions (specific email addresses or whole domains) to Postfix.

    How to add exclusions to Postfix:

    1. Create the /etc/postfix/rbl_override file:

      # touch /etc/postfix/rbl_override

    2. Edit /etc/postfix/rbl_override file and add domains  - one per line:

      # vi /etc/postfix/rbl_override
      gmail.com OK
      outlook.com OK

    3. Convert the file into a lookup table:

      # postmap /etc/postfix/rbl_override

    4. Alter the Postfix configuration file /etc/postfix/main.cf in regard to the following directive:

      smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_rbl_client sbl.spamhaus.org

      It should look like:

      smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, check_client_access hash:/etc/postfix/rbl_override, reject_rbl…