INSTALL INSTRUCTIONS This is basically my HOW-TO install SpamAssassin on a RedHat system using sendmail and check all the mail using a Milter. The only reason to run this install is if you want to run a sendmail that then simply forwards the mail to another mail exchange. These documents assume you have already installed Sendmail and SpamAssassin per the current instructions at http://www.peregrinehw.com/download. #UPDATED 8/28/02 for SpamAss Milter v0.1.2 #UPDATED 8/31/02 for SpamAss Milter running as non-root user #UPDATED 12/18/02 for Sendmail 8.12.6: Simple Path Changes #WGET, UNTAR & INSTALL THE VARIOUS SUPPORT DISTRIBUTIONS # # NOTE: Yes, I do know that CPAN can do this automatically but I am a bit of a freak who likes to confirm # the exact version I am getting. # #CREATE A TEMP DIR FOR THE TAR FILES rm -rf /tmp/20020828SPAM/ mkdir /tmp/20020828SPAM cd /tmp/20020828SPAM/ #GET ALL THE TAR FILES wget http://www.peregrinehw.com/downloads/SpamAssassin/spamass-milter-0.1.2.tar.gz wget http://www.peregrinehw.com/downloads/SpamAssassin/spamassmilter-initscript #CLEAR OUT OLD SOURCE rm -rf /usr/src/spamass-milter-* #RE-COMPILE SENDMAIL WITH LIBMILTER cd /usr/src/sendmail-8.12.6 ####Delete the obj.Linux.* dirs, I think? rm -rf obj.Linux.* echo "APPENDDEF(\`conf_sendmail_ENVDEF', \`-DMILTER')" >> devtools/Site/site.config.m4 cd libmilter sh Build sh Build install cd .. sh Build sh Build install ####YOUR PATH MAY/WILL VARY BASED ON YOUR KERNEL!! VERIFY PATH! cd /usr/src/sendmail-8.12.6/obj.Linux.2.4.19.i686/libsm cp libsm.a /usr/lib/ #INSTALL SPAMASS-MILTER cd /usr/src/ tar zxvf /tmp/20020828SPAM/spamass-milter-0.1.2.tar.gz cd spamass-milter-0.1.2/ ./configure make make install ln -s /usr/local/sbin/spamass-milter /usr/local/sbin/spamassmilter echo "INPUT_MAIL_FILTER(\`spamassassin', \`S=local:/var/run/spammilter/spamass.sock, F=, T=C:15m;S:4m;R:4m;E:10m')" >> /etc/mail/sendmail.mc m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf cp /tmp/20020828SPAM/spamassmilter-initscript /etc/rc.d/init.d/spamassmilter chmod +x /etc/rc.d/init.d/spamassmilter cd /etc/rc.d/rc3.d ln -s ../init.d/spamassmilter S79spamassmilter #UPDATED 08-31-02 not to run as root #Thanks to Dan Nelson for his input! mkdir /var/run/spammilter chown spamd.spamd /var/run/spammilter #Start SpamAssMilter and Restart Sendmail and you should be on your way /etc/rc.d/init.d/spamassmilter start /etc/rc.d/init.d/sendmail restart #REMOVE THE TEMP DIR FOR THE TAR FILES rm -rf /tmp/20020828SPAM/ #NOTES ABOUT HOW TO USE THIS MILTER TO FILTER YOUR MAIL This is more of a sendmail question but very related so I am including this real world example. Assuming you have installed the milter, you are just trying to make this installation a temporary hop on the way to the mailbox. So if the mail is getting to /var/spool/mail then it's not working correctly. Let's assume your domain is lookdumb.net. Let's assume your Spam Milter box is IP 200.200.200.1. Let's assume your final destination MX is an internal IP firewalled by your SPAM Milter Box on IP 192.168.1.1 Set your DNS like this: lookdumb.net IN MX 5 internalmx.lookdumb.net <--Primary MX is internal lookdumb.net IN MX 10 mx.lookdumb.net <--Secondary MX is external ...More Backup MX Records... internalmx.lookdumb.net IN A 200.200.200.1 mx.lookdumb.net IN A 192.168.1.1 On the Spam Milter box, make certain your local-host-names does NOT include lookdumb.net. Make sure your relay-domains DOES include lookdumb.net. Then what will happen is as follows: A person emails a user @ lookdumb.net. EMail is transmitted to their SMTP server. Their server looks up the MX records and gets internalmx.lookdumb.net It can't connect. It looks up the next MX priority and gets mx.lookdumb.net It can connect and the mail is transferred to your milter box. Your milter box now filters for spam and looks to see where it has to go next. It's NOT the local host so it looks up the MX records. It gets internalmx.lookdumb.net It CAN connect It transfers the mail all nicely filtered. VOILA! Hope this helps!