This software is still in beta test.
Use at your own risk.
Sendmail includes a facility for plugging in custom mail filters, called milters. It's documented here. Blackmilter implements a blacklist of IP addresses which are not permitted to send mail to this host. Any mail attempts from blacklisted addresses are rejected immediately upon connection, before the mail gets transmitted.
This could also be accomplished by turning the blacklists into a set of firewall rules for port 25. However, current firewall implementations process their rules sequentially, one by one. If you have a lot of hosts you want blocked, this is too costly. Blackmilter stores the IP addresses in a data structure that is both fast and reasonably compact. If you wanted to, you could block millions of addresses quite efficiently.
A more reasonable alternative is the access database built into sendmail. However, benchmarking shows that blackmilter is much faster at this task - from thirty to sixty times faster. Same for using a DNS-based RBL - blackmilter is vastly faster. If you are getting a lot of mail and blocking a lot of IP addresses, this can make a difference. Also blackmilter has some advantages in flexibility, such as the autoupdate and socket update features.
Blackmilter does not specify any particular blacklisting policy. It is merely a clean and simple tool to let you efficiently implement whatever policy you choose.
This is very abbreviated, intended mainly as a reminder for those who have worked with milters before. If it's your first milter, you should look on the web for more thorough documentation. Also, these instructions are pretty specific to FreeBSD, and will have to be adapted for other OSs.
If you don't see MILTER in the compilation options, you will have to re-build sendmail.sendmail -d0.1 -bt < /dev/null | grep MILTER
Rebuild and install sendmail.cf.INPUT_MAIL_FILTER(`blackmilter',`S=unix:/var/run/blackmilter.sock, T=S:4m;R:4m')
# blackmilter -b /etc/smtp_blacklist unix:/var/run/blackmilter.sock
blackmilter_enable="YES" blackmilter_flags="-a -b /etc/smtp_blacklist" blackmilter_socket="unix:/var/run/blackmilter.sock"