Skip to navigation
Postfix with spamassassin
05.01.15
1) Create a bash script to receive e-mail from Postfix and pipe it to SpamAssassin for rewriting. Then forward the rewritten version to Postfix's sendmail implementation: #!/bin/bash # # spamfilter.sh # # Simple filter to plug SpamAssassin into the Postfix MTA # # Modified by Jeremy Morton # # This script should probably live at /usr/bin/spamfilter.sh # ... and have 'chown root:root' and 'chmod 755' applied to it. # # For use with: # Postfix 20010228 or later # SpamAssassin 2.42 or later # Note: Modify the file locations to suit your particular # server and installation of SpamAssassin. # File locations: # (CHANGE AS REQUIRED TO SUIT YOUR SERVER) SENDMAIL=/usr/sbin/sendmail SPAMASSASSIN=/usr/bin/spamc logger <<<"Spam filter piping to SpamAssassin, then to: $SENDMAIL $@" ${SPAMASSASSIN} | ${SENDMAIL} "$@" exit $? 2) Ensure the newly-created /usr/bin/spamfilter.sh has correct permissions (0755), and is owned by root:root. 3) Modify the /etc/postfix/master.cf file; first, change the first 'smtp' line of the file to: smtp inet n - - - - smtpd -o content_filter=spamfilter Then, add the following (a call to our newly-created spamfilter script) at the end: spamfilter unix - n n - - pipe flags=Rq user=spamd argv=/usr/bin/spamfilter.sh -oi -f ${sender} ${recipient}
http://wiki.apache.org/spamassassin/IntegratedSpamdInPostfix
Reply
Anonymous
Information Epoch 1736603968
Think hierarchically.
Home
Notebook
Contact us