Help - Search - Members - Calendar
Full Version: [How to] add DNSBLs to sendmail with Ensim Pro 4.0.2 RHEL
The Planet Forums > Control Panels > Ensim > Ensim HOWTOs
maf
[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.
ISVY
[root@ns1 install]# m4 /usr/lib/opcenter/sendmail/install/sendmail.mc > /etc/mail/sendmail.cf
/usr/share/sendmail-cf/feature/dnsbl.m4:33: m4: Warning: Excess arguments to built-in `len' ignored


i have this problem how to fix please?
Penguin
Isvy, you haven't followed the instructions to the letter have you:

QUOTE
. 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


This really for clarification should be changed to dnl FEATURE(`delay_checks', `friend')dnl

If this is not the case, copy your sendmail.mc.bak file back to sendmail.mc and regenerate the sendmail.cf file again to ensure that it's ok to start with and then try again.


QUOTE
11. Do a maintenance cycle to update Ensim and restart sendmail  
# /usr/local/sbin/set_pre_maintenance
# /usr/local/sbin/set_maintenance
# /usr/local/sbin/set_post_maintenance
# /sbin/service webppliance restart


This isn't actually necessary as the maintenancm mode is to update & populate the virtual filessytem of each site, however this filtering is done at server level and so you'll just be sitting there for a while whilst it completes for no necessary reason.
L.J
I got the same error as ISVY until I changed this line

QUOTE
FEATURE(`dnsbl', `sbl-xbl.spamhaus.org', `"550 Sorry, your address " $&{client_addr} " was rejected - see: http://www.spamhaus.org/"')dnl

to this
QUOTE
dnl FEATURE(`dnsbl', `sbl-xbl.spamhaus.org', `"550 Sorry, your address " $&{client_addr} " was rejected - see: http://www.spamhaus.org/"')dnl


But after sending the email from my server maf I get 2 emails back. The first says

QUOTE
Uh-oh, your SBL block is not working!


and the 2nd is a copy of the transcript connection to my smtp server with it also saying that the email got delivered and this might not be want I want.


Any ideas?
L.J
So I've gone back to my previous sendmail just in case of any hicups atm.
TMX
The "dnl" at the beginning of a line in your sendmail.mc defines that particular line as a comment, and effectively disables it. In order for the entry to work, the leading "dnl" must be removed from it.

As for the how-to itself, try this one instead:
http://forum.ensim.com/showpost.php?p=4229...290&postcount=4

Follow it to the letter and your setup will work.

A few notes:

a) As Penguin stated above, if you're having trouble, revert back to your stock sendmail.mc to verify its operation before continuing.

b) It is not necessary to run maintenance mode after making your changes

c) The FEATURE(`delay_checks', `friend')dnl line allows authenticated users, ie; your clients, to utilize your mail server normally even in the event their IP is listed on one of your DNSBLs. Without it, they would be denied right along with the spammers. The 'friend' part enables sendmail's spamfriend feature, should you decide to use it somewhere down the line. A good use for it is to make your abuse@ address a 'spamfriend' in order to receive whitelisting requests, etc...from blacklisted entities.

-B
tyrnight
QUOTE (ISVY)
[root@ns1 install]# m4 /usr/lib/opcenter/sendmail/install/sendmail.mc > /etc/mail/sendmail.cf
/usr/share/sendmail-cf/feature/dnsbl.m4:33: m4: Warning: Excess arguments to built-in `len' ignored


i have this problem  how to fix please?


QUOTE
FEATURE(`dnsbl', `sbl-xbl.spamhaus.org', `"550 Sorry, your address " $&{client_addr} " was rejected - see:http://www.spamhaus.org/"')dnl


remove the comma next to "Sorry"

that will fix it
CyberSEAL
I had a problem and posted it here, but quickly found the solution. I had a typo in my sendmail.mc file.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.