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_keyyou 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:
When you see the box below, it means that you need to enter the command on your shell:
When 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,`your_DQS_key.zen.dq.spamhaus.net', `"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