[Exim] Spam Assasin and Exim Configuration using spamd

Top Page
Delete this message
Reply to this message
Author: Marc Perkel
Date:  
To: Volker Augustin, Spamassassin-devel, exim-users
Subject: [Exim] Spam Assasin and Exim Configuration using spamd
Hi - I'm using Spam Assassin as a daemon with Exim 3.35. The config
files for Exim 4 are different but you sould be able to figure that out.
It uses spamd daemon and spamc.

# Spam Assassin
spamcheck_director:
  no_verify
  domains = lsearch;/etc/exim/vdomains
  condition = "${if and { \
                        {!def:h_X-Spam-Flag:} \
                        {!eq {$received_protocol}{spam-scanned}} \
                        {!eq {$received_protocol}{local}} \
                        } {1}{0}}"
  driver = smartuser
  transport = spamcheck


# Spam Assassin
spamcheck:
    driver = pipe
    command = /usr/sbin/exim -oMr spam-scanned -bS
    transport_filter = /usr/bin/spamc
    bsmtp = all
    home_directory = "/tmp"
    current_directory = "/tmp"
    user = mail
    group = mail
    return_path_add = false
    log_output = true
    return_fail_output = true
    prefix =
    suffix =


And - if you're using RedHat Linux - here's my spamd startup.

#!/bin/sh
#
# spamassassin This script starts and stops the spamd daemon
#
# chkconfig: 2345 81 30
#
# description: spamd is a daemon process which uses SpamAssassin to check
#              email messages for SPAM.  It is normally called by spamc
#           from a MDA.
# For virtual email - I use OPTIONS -d -F0 -x


# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Source spamd configuration.
if [ -f /etc/sysconfig/spamd ] ; then
    . /etc/sysconfig/spamd
else
    OPTIONS="-d -c -a"
fi


[ -f /usr/bin/spamd -o -f /usr/local/bin/spamd ] || exit 0
PATH=$PATH:/usr/bin:/usr/local/bin

# See how we were called.
case "$1" in
  start)
    # Start daemon.
    echo -n "Starting spamd: "
    daemon spamd $OPTIONS
    RETVAL=$?
    echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/spamd
    ;;
  stop)
    # Stop daemons.
    echo -n "Shutting down spamd: "
    killproc spamd
    RETVAL=$?
    echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/spand
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  status)
    status spamd
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
esac


exit 0