#!/bin/sh # # SA-only.sh # # Simple filter to plug SpamAssassin only # into the Postfix MTA # # From http://advosys.ca/papers/postfix-filtering.html # Advosys Consulting Inc., Ottawa # # For use with: # Postfix 20010228 or later # SpamAssassin 2.42 or later # # Note: Modify the file locations to match your particular # server # File locations: # (CHANGE AS REQUIRED TO MATCH YOUR SERVER) SENDMAIL="/usr/lib/sendmail -i" SPAMASSASSIN=/usr/bin/spamassassin # Exit codes from EX_TEMPFAIL=75 EX_UNAVAILABLE=69 cat | $SPAMASSASSIN -x | $SENDMAIL "$@" || \ { echo Message content rejected; exit $EX_UNAVAILABLE; } exit 0