Configuring DQS on Sendmail

This details how to use the Data Query Service (DQS) 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. This is recommended because both SpamAssassin and Rspamd should be seen 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 Sendmail is outside this document’s scope. Please ask your systems integrator for assistance, should you need to do this.

If you are using SpamAssassin or Rspamd please see the links below. These provide information on how to install our plugin to get the best performance and catch rates from the DQS:

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.

  • When you see the word your_DQS_key you need to replace it with your actual DQS key. Failing to do so will prevent you from successfully querying the DQS.

For example, assuming your key is aip7yig6sahg6ehsohn5shco3z, the following line:	

will become:
  • When you see the box below, it means that you need to enter the command on your shell:

	$ command
  • When 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