View previous topic :: View next topic |
Author |
Message |
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Tue Nov 20, 2007 6:03 pm Post subject: postfix and spam |
|
|
Hi,
I want to enable the use of spam protection on my email server. Do I need to patch your postfix to support spam filtering or is it already patched? I've read that for postfix to really support spam filtering there are patches that need to be applied.
This morning I came across a posting about postfix and spam. What do you think about the suggestions the poster made?
http://blog.taragana.com/index.php/archive/6-simple-safe-postfix-changes-for-over-95-spam-reduction/
thanks - any advice is greatly appreciated. |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Tue Nov 20, 2007 7:08 pm Post subject: |
|
|
That's is well known postfix configuration for fighting spam.
It got to do with configuration and not spam-filters.
Depends on your server it might work it might don't, it might work if you apply the configuration partial.
Quote: | I've read that for postfix to really support spam filtering there are patches that need to be applied. |
I've never heard of that, it might be true or applies for older versions.
I didn't activate spamassassin after postfix take in charge cause I'm not quite sure if I'll keep it or replace it in postfix configuration.
To enable it just edit /etc/postfix/master.cf
uncomment under smtp # -o content_filter=spamassassin
Code: | smtp inet n - n - - smtpd
# -o receive_override_options=no_address_mappings
# -o content_filter=spamassassin |
and add to the bottom
Code: | spamassassin unix - n n - - pipe
user=nobody argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient} |
do a postfix reload
messages might delay a little though. If you look at /var/log/mailog you will see
relay=spamassassin, status=sent (delivered via spamassassin service)
edit: Forgot the most important.
remove /etc/rc.d/rc.spamd and create a new /etc/rc.d/rc.spamd or rc.spamassassin
with below start up script.
Code: | #!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
DAEMON=/usr/bin/spamd
NAME=spamd
SNAME=rc.spamassassin
DESC="SpamAssassin Mail Filter Daemon"
PIDFILE="/var/tmp/$NAME.pid"
PNAME="spamd"
DOPTIONS="-d --pidfile=$PIDFILE"
KILL="/bin/kill"
KILLALL="/bin/killall"
# Defaults - don't touch, edit /etc/mail/spamassassin/local.cf
ENABLED=0
OPTIONS=""
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
$PNAME $OPTIONS $DOPTIONS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
$KILL `cat $PIDFILE`
/bin/rm $PIDFILE
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
$0 stop
sleep 1
$0 start
echo "$NAME."
;;
*)
ME=/etc/rc.d/$SNAME
echo "Usage: $ME {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|
You can place an entry in /etc/rc.d/rc.local to start at boot with
Code: | #Starting spamassassin
if [ -x /etc/rc.d/rc.spamd ]; then
. /etc/rc.d/rc.spamd start
fi |
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com
Last edited by gerasimos_h on Tue Nov 20, 2007 7:54 pm; edited 1 time in total |
|
Back to top |
|
baboo Senior Member
Joined: 04 Sep 2007 Posts: 676
|
Posted: Tue Nov 20, 2007 7:35 pm Post subject: |
|
|
as always very helpful reply. Thanks for the info. |
|
Back to top |
|
|