Tim's Sendmail REGEX Patches

Tim's Sendmail REGEX Patches

This patch will allow for regex checks of the body of all messages. It is based on the existing MAP_REGEX work.

Warning! Use of this will result in users not being able to report spam to your abuse@ email address!

If your running something newer than 8.11 then check out the newest version.

  1. Get a copy of sendmail 8.11.1 from sendmail.org
  2. Get a copy of the patch.
  3. Patch the source
    patch < regex_patch
  4. Fix up devtools/Site/site.config.m4
    add APPENDDEF(`confMAPDEF', `-DMAP_REGEX') (this may not be needed but wont hurt to ad)
    add APPENDDEF(`confENVDEF', `-DREGEX_BODY')
  5. run sh ./Build
  6. update your cf/cf/config.mc by adding a LOCAL_CONFIG section like this:
    LOCAL_CONFIG
    #
    #  Regular expression to reject:
    #
    Kbodyregex regex -a@MATCH ^(spam|SPAM)
    
  7. Make config.cf with
    make config.cf
  8. Test new config:
    ../../obj*/sendmail/sendmail -v -bs -C ./config.cf
    mail from: me@here.com
    rcpt to: root
    data
    message to test filter
    .
    
  9. Change the regex to a real list of spam. rebuild and test again
    Kbodyregex regex -a@MATCH (Millions of Email|new auto today|800-618-1495)

If sendmail won't filter on the patterns, make sure you built it with the -DREGEX_BODY. The easy way is to remove the obj.* build directory and rerun ./Build

Stuff I would like to add: