How to implement "Realtime Blackhole List database"

I would like to activate the Realtime Blackhole List database on my install of sendmail...

I would like to know :
1) how to activate this
2) if there might be any implications of activating this
3) if I can switch it on and off for particular domains on my server
4) If I need to pay anything for it
5) how i can test it

I have found the following information in the sendmail manual...  But it doesn't realy answer all of my questions.

I have the latest version of sendmail.

This will cause sendmail to reject mail from any site in the Realtime Blackhole List database. You can specify an alternative RBL name server to contact by specifying an argument to the FEATURE. The default error message is "Mail from $&{client_addr} refused by blackhole site DOMAIN" where DOMAIN is replaced by the first argument. A second argument can be used to specify a different text. This FEATURE can be included several times to query different DNS based rejection lists, e.g., the dial-up user list (see

The features described above make use of the check_relay, check_mail, and check_rcpt rulesets. If you wish to include your own checks, you can put your checks in the rulesets Local_check_relay, Local_check_mail, and Local_check_rcpt. For example if you wanted to block senders with all numeric usernames (i.e., you would use Local_check_mail and the new regex map:

     Kallnumbers regex -a@MATCH ^[0-9]+$
     # check address against various regex checks
     R$*                    $: $>Parse0 $>3 $1
     R$+ < @ > $*     $: $(allnumbers $1 $)
     R@MATCH                    $#error $: 553 Header Error

These rules are called with the original arguments of the corresponding check_* ruleset. If the local ruleset returns $#OK, no further checking is done by the features described above and the mail is accepted. If the local ruleset resolves to a mailer (such as $#error or $#discard), the appropriate action is taken. Otherwise, the results of the local rewriting are ignored.


Many thanks in advance
Who is Participating?

Improve company productivity with a Business Account.Sign Up

moduloConnect With a Mentor Commented:
PAQed, with points refunded (200)

Community Support Moderator
The "Realtime Blackhole List" mentioned above is a subscription service, so unless you've bought that service you can't simply enable it. Take a look at for more information about it. There are some free lists available that you can use, like:
I think this question is more focused on how to activate m4 features - I did this a while back, but I usually just grab a good that does what I want and adjust it if needed.

>so unless you've bought that service you can't simply enable it

Sigh - I long for the days of free MAPS.  I could ruminate at length about the politics of free vs pay services (and the evolution of one from the other), but I would bore everyone to tears, and this question would remain unsolved.

I will attempt to address the above 5 issues:

1.  Read up on regenerating your via m4 - if you need specific examples, I may be able to provide them.

2. False positives are your biggest concern, as well as the balkenization of blackhole lists after the demise or ORBS and the transitiion of MAPS to a pay service - if you use a blackhole list, be sure you are getting it from the originating collector of such data.

3.  Jim might be able to provide more info, but AFAIK, there is not currently a way (without hacking, which as anyone can tell you is mind-numbing, and makes your eyes bleed)  

4.  Depends which RBL you wish to use

5.  Easy - just configure another server to have a blacklisted IP, set up an appropriate networking config to be able to reach your mailserver, and hammer away.

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

coopaAuthor Commented:
Thanks Jon and jlevie.

I am away on holiday for 2 weeks but I'll post more on this when I get back.

I have noticed some code that you can enable on (which looks free... is it?)

anyway when I put that in the .mc and ran that through m4 It came up with the following lines...
As you said jon, these imediately caused eye-bleed.

I placed them in the file and restarted sendmail... shock-horror it wouldn't restart... something about missing <TAB> characters.

Here are the sendmail.if lines....  Any ideas ?

# DNS based IP address spam list
R$*                     $: $&{client_addr}
R::ffff:$-.$-.$-.$-     $: <?> $(host $4.$3.$2.$ $: OK $)
R$-.$-.$-.$-            $: <?> $(host $4.$3.$2.$ $: OK $)
R<?>OK                  $: OKSOFAR
R<?>$+                  $#error $@ 5.7.1 $: "Email blocked using - see <"$&{client_addr}>
coopaAuthor Commented:
Worked it out....  
between all of those lines of code I needed a <tab> character
R$*                     $: $&{client_addr}
     ^these should be tabs not spaces.

I'll retry this when I get back in two weeks.
Yes, is free, and yes you have to use tabs not spaces in a sendmail config file. Also one needs to be aware that single quotes in a config file are left and right single quotes, i.e., `nnn', not 'nnn'.
listening ..
uninstall sendmail and install Postfix.  You can probably find a FAQ on how to do this with your distribution.  edit the /etc/postfix/ to include:

maps_rbl_domains =


smtpd_client_restrictions = hash:/etc/postfix/access, permit_mynetworks, reject_maps_rbl, permit

issue a postfix reload and you're off.

My experiance with these two RBLs is very positive and can't remember legitimate mail being rejected...your mileage may vary...its free, and you can argue that sites should not be listed if you have a valid reason to....
The easiest way to add RBL support is add lines like this to


and then regenerate with the command:

m4 /etc/mail/ > /etc/

It seems to be happy and puts all the right entries into but it isn't working for me.  I have another question posted on this exact topic.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.