This is a Milter for Sendmail 8.12 that checks mail messages using razor-check and rejects ones that are found in the razor database.
It is extremely simple, it just pipes the mail message to a forked off version of razor-check and looks at the return value. Since sendmail sends messages with CRLF at the end of each line and razor-check doesn't like that, it does strip off the CR.
I run it on FreeBSD using Vipul's Razor 2.14 and Sendmail 8.12.3. Vipul submitted a patch that gets it to compile on Linux which I've incorporated. Jamie Orzechowsk got in running on Redhat 7.2 and helped me kill some bugs, so it should work nicely on Redhat 7.2. Bobby Rose has helped me get it working on Solaris 8.
To use it with Sendmail 8.12 you must have compiled Sendmail with Milter support. To do that, you add this to your site.config.m4 file when compiling Sendmail:
APPENDDEF(`conf_libmilter_ENVDEF', `-DMILTER') APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')
Then you add this to your .mc file that you use to build your sendmail.cf file:
Then you need to run 'smrazor' as root. It is a daemon that does not fork itself. I do this:
./smrazor -p local:/var/run/f1.sock&
Now every message that comes into sendmail will be checked with razor-check. If it is rejected, it logs the 'From' and 'Subject' lines to '/tmp/razored.log'.
It also spits out debug messages from razor-check to '/tmp/razor.err'.
It always accepts any messages that are to users who start with 'spam'. This is because I route those emails using procmail to razor-report.
Most of this stuff is hardcoded into the program, but it is pretty simple to work with, so have at it.
More information on Milter is at:
More information or Vipul's Razor is at:
Feel free to email me about it at: