[How to] add DNSBLs to sendmail with Ensim Pro 4.0.2 rhel (although this should work with 3.7 or higher)
Edits on Sept 6, 2006:
1. Fixed typo (deleted a comma) that caused the "Warning: Excess arguments to built-in `len' ignored" error.
2. Removed the maintenance cycle suggestion.
3. Tested with Ensim Pro X as well.]
I gathered this info from various other answers here and on Ensim's forums. Thanks to all who figured out steps along the way to what changed in this version of Ensim.
1. Backup your existing sendmail.cf file:
# cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak
2. Go to your Ensim mail configuration directory:
# cd /usr/lib/opcenter/sendmail/install/
3. Backup your existing sendmail.mc file:
# cp sendmail.mc sendmail.mc.bak
4. Edit the sendmail.mc file with vi:
# vi sendmail.mc
5. Find the line:
dnl FEATURE(delay_checks)dnl
hit i to get into insert mode and change it to read:
FEATURE(`delay_checks', `friend')dnl
6. Now go to almost the end of the file and look for the line:
include(`/usr/lib/opcenter/sendmail/install/popauth.m4')
7. Add your dnsbl entries after that line or else you will get the following error or similar when restarting sendmail:
"Starting sendmail: 554 5.0.0 /etc/mail/sendmail.cf: line 204: readcf: map popauth: class dnsbl not available" or
"Starting sendmail: 554 5.0.0 /etc/mail/sendmail.cf: line 221: readcf: map popauth: class sbl not available"
8. For example, I rely on SpamAssassin and MailScanner for the most part but SpamAssassin by default uses a low rating for Spamhaus hits. I happen to trust Spamhaus and like bouncing a bunch of spam at the front door rather than wasting scanning resources on them farther down the chute with MailScanner and SpamAssassin, so the only entry I add is this (remember, no line wraps allowed):
FEATURE(`dnsbl', `sbl-xbl.spamhaus.org', `"550 Sorry your address " $&{client_addr} " was rejected - see: http://www.spamhaus.org/"')dnl
9. Hit esc to exit insert mode and write and quit with ":wq"
10. Rebuild the sendmail.cf file
# m4 /usr/lib/opcenter/sendmail/install/sendmail.mc > /etc/mail/sendmail.cf
11. Once you have set up your mail server to use sbl.spamhaus.org, you can test to see if the SBL blocking is
working by sending an email (any email) to: nelson-sbl-test@crynwr.com (you must send the email from the mail server which you wish to test). The Crynwr system robot will answer you to tell you if your server is correctly blocking SBL-listed IPs or not.
12. For fun, watch your mail log for awhile and watch the spam get blocked (look for the spamhaus references):
# tail -f /var/log/maillog
ctrl-c when you've had enough geekiness.