Alan Fullmer
Super Administrator
       
Posts: 62
Registered: 8-12-2004
Member Is Offline
Mood: No Mood
|
posted on 8-12-2004 at 07:11 PM |
|
|
Easy way to configure / install Postfix and Spamassassin
Please note: File locations are based on my own install. Yours may be different, and should be checked and appropriate changes made.
1. Install postfix and get it working for your domain. See http://www.postfix.org for
details.
2. Install SpamAssassin. The easiest way to do this is with the command "perl -MCPAN -e 'install Mail::SpamAssassin'" OR you can compile it.
Another way is to use an RPM (RedHat or Fedora) or "apt-get install postfix spamassassin spamc" (if you have debian)
3. As root, create a file at /usr/local/bin/spamfilter.sh with the following content:
#!/bin/bash
/usr/local/bin/spamc | /usr/sbin/sendmail -i "$@"
exit $?
4. Run "chmod 755 /usr/local/bin/spamfilter.sh" then make sure you have it executable: "chmod -x /usr/local/bin/spamfilter.sh"
5. Create a user called 'spamfilter'. Make it a complete user, with home directory and shell. (I prefer setting the shell to false.) example:
useradd -d /home/spamfilter -s /bin/false spamfilter
6. Run "chown spamfilter:spamfilter /usr/local/bin/spamfilter.sh"
7. In /etc/postfix/master.cf in the "Services" section, alter the 'smtp' line as follows (the " -o con..." SHOULD be on the next line: NOTE:
there are two lines that have smtp. Make sure it is the inet line. Usually the first line.
# -----------------------------------------------------------------------------------
smtp inet n - n - - smtpd
-o content_filter=spamfilter:dummy
# -----------------------------------------------------------------------------------
8. In /etc/postfix/master.cf in the "Interfaces to non-Postfix software" section add:
# -----------------------------------------------------------------------------------
spamfilter unix - n n - - pipe
flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient}
# -----------------------------------------------------------------------------------
9. Restart postfix and make sure you can still get email. Send a fake spam through the system (from an outside address) to verify that spam is marked
as spam. For information on configuring SpamAssassin, go to http://www.spamassassin.org.
|
|
|
Jerome
Junior Member

Posts: 3
Registered: 9-4-2008
Member Is Offline
|
posted on 9-4-2008 at 04:15 AM |
|
|
I am getting the same symptoms as described by Lise on 5-12-2007. i.e. no apparent error, messages filtered and "delivered via spamfilter service"
but always delivered to undisclosed-recipients with empty body of the message.
Any follow up on her post ?
Cheers
jerome
|
|
|
Alan Fullmer
Super Administrator
       
Posts: 62
Registered: 8-12-2004
Member Is Offline
Mood: No Mood
|
posted on 27-5-2008 at 02:22 PM |
|
|
I would check to make sure all permissions are good. I read in the other post that you had some problems with that. It is a good idea to let the
system create the directories for .spamassassin, etc.
Also ensure your script is passing the proper argument to the spamc.
|
|
|
Greysone
Newbie
Posts: 1
Registered: 19-11-2009
Member Is Offline
|
posted on 19-11-2009 at 12:16 AM |
|
|
Thanks for sharing on how to install the spamassasin..Thanks a lot for this.Cheers.
Regards
Greysone
Surendettement
|
|
|