How to Add RBL lists, without getting sucked in.




  What is an RBL list?

An RBL style list is a basicly a DNS server that maintains a list of known spam rlays.
It is used by sendmail (or another MTA) when mail is recived. The MTA will make a standard
DNS query to the list server of your choice and reject the incoming mail if the server it
originated from is listed in the RBL server. This will cause incoming spam to be rejected
without even having the message come to your server and waste your bandwidth.
  Adding a list to your sendmail config the easy way.

RedHat and Mandrake Systems:

Both of these systems (and others based off of RedHat ship with a file /etc/mail/sendmail.mc
that is a complete set of m4 macros needed to generate a fres /etc/sndmail.cf The easiest approach
is to open this file in your favorite text editor and add a line like this,

FEATURE(dnsbl, `relays.osirusoft.com', `Rejected - see http://relays.osirusoft.com')dnl
FEATURE(`dnsbl', `relays.ordb.org', `Rejected - see http://ordb.org/')dnl

As you can see I have two in mine, there are other lists to wich I will link to below.
This strictly speeking is not needed, in fact more then one will cause a performance hit
but will catch more spam so it is up to you as to what your needs are. You could even
include more, MAPS maintains 3 different lists plus a fourth that includes all three but
they now charge for access if you site is in any way commercial.

After adding those lines to your sendmail.mc file all you need to do is as root execute
the following command from the /etc/mail dir.

m4 sendmail.mc > ../sendmail.cf

It would be a good idea to back up your old /etc/sendmail.cf beforehand.
After running the m4 comman restart sendmail and you are done.

FreeBSD
On release 4.4+ the file you need to edit is,

/etc/mail/freebsd.mc

Other Linux/Unix systems: If your running sendmail setup will be very similar but the file locations are probally
different, I will add exact instructions shortly after looking on a few of these machines.
Other MTA's There is a large listing of other MTA's and how to set them up here,

http://www.mail-abuse.org/rbl/usage.html
  Testing your setup.
You can use the following command and inputs to verify your setup.

sendmail -bt -C /config/to/test/sendmail.cf
> .D{client_addr}127.0.0.1
> Basic_check_relay <>
rewrite: ruleset 192 input: < >
rewrite: ruleset 192 returns: OK
> .D{client_addr}127.0.0.2
> Basic_check_relay <>
rewrite: ruleset 192 input: < >
rewrite: ruleset 192 returns: $# error $@ 5 . 7 . 1 $: "Mail from " 127 . 0 . 0 . 2 " refused; see http://www.mail-abuse.org/cgi-bin/lookup?127.0.0.2"
> CTRL/D

The output/responses will be slightly different depending on your sendmail
version and the list you used.
  An incomplete listing of RBL style lists.
Open relay Database
Osirusoft's Open Relay Datatbase
Spamhaus.org Note that Osirusoft's database contains a copy of the spamhaus db.
MAPS The original but now non free spam relay laist. Aslo the best organised and
if you can afford it probally the best. Free access is avaliable for hobby sites.



The Following has been a Notwise-Labs Document, if you do this and the world ends we are not responsible.





Copyright 2002 Notwise-Labs under the You Break it You Buy it License. (GNU-YBBL)