Spamhaus Project Public Mirrors using Sendmail
This details how to use the Public Mirrors with the Sendmail MTA, including how to configure rejections at the SMTP level.
NOTE: If you use Postfix with Rspamd or SpamAssassin, you should not configure rejections at the SMTP level. Instead, use a milter and let SpamAssassin or Rspamd do the filtering. We recommended this because both SpamAssassin and Rspamd should be viewed as an anti-spam framework i.e., they need all the relevant information relating to an email to utilize their auto-learning features, so they filter emails effectively.
Configuring a milter and integrating it with SpamAssassin or Rspamd with Postifx is outside this documents scope. Please ask your systems integrator for assistance, should you need to do this.
Blocking at the SMTP level is only suggested if you have a moderately high email volume (more than 200,000 emails per day), low computing resources, or if you do not use additional anti-spam software.
This document assumes that your Sendmail configuration directory is
/etc/mail. If this is not the case, change the path accordingly, where it is referenced.
Whenever you see the box below, it means that you need to enter the command on your shell:
Whenever you see the box below, it means that you need to enter the command on a shell with root privileges:
sendmail.mc file, that is usually located under
/etc/mail, and add the following line
FEATURE(enhdnsbl,`zen.spamhaus.org', `"554 Connecting client IP address listed in Spamhaus ZEN. See https://www.spamhaus.org/query/ip/"$client_address" for details"', `127.0.0.2', `127.0.0.3', `127.0.0.4', `127.0.0.9', `127.0.0.10', `127.0.0.11')dnl
Note that the single quotation marks are not all the same: the first quotation mark in each pair is a backquote; the second is an apostrophe.
After that, run the following:
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf # /etc/init.d/sendmail reload