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:

	$ command
  • Whenever you see the box below, it means that you need to enter the command on a shell with root privileges:

	# command


Edit your file, that is usually located under /etc/mail, and add the following line

FEATURE(enhdnsbl,`', `"554 Connecting client IP address listed in Spamhaus ZEN. See"$client_address" for details"', `', `', `', `', `', `')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/ > /etc/mail/
	# /etc/init.d/sendmail reload