[Exim] setting up spamassassin

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: dman
Data:  
Para: debian-user, exim-users
Tópicos Novos: [Exim] Re: setting up spamassassin (alternative)
Assunto: [Exim] setting up spamassassin
I'm now trying to set up spamassassin on my system, but am running
into some hurdles.  I use exim as my MTA, so I'm following the guides
at
    http://bogmog.sourceforge.net/document_show.php3?doc_id=28


I installed the 'spamassassin' and 'razor' packages. The script works
fine if I run it as myself and pipe messages through it. The trick is
making exim run the checks automatically.

Due to exim's architecture, the message is delivered to a pipe, the
pipe is connected to spamassassin. When spamassassin is finished
tagging the message it is sent back to exim. exim only delivers to
spamassassin if it hasn't been tagged yet, otherwise it continues to
my filter file. This part is fine. I took the "spamcheck.pl" given
at the above site and made an sh script from it. This script takes
the message, runs it through spamassassin and gives it back to exim.

~~~~~~~~~~~~~~~~~
#!/bin/sh

# wrapper script to use SpamAssassin with exim

#SENDER="$1"
#if [ -z "$SENDER" ] ; then
#    SENDER='<>'
#fi
shift 1


# The recipient list
RCPT="$@"

if [ -z "$RCPT" ] ; then
    echo "spamcheck.sh called with insufficient arguments!"
    exit 126
fi


# Run the message through spamassassin and pass it back to exim
cat | spamassassin -P -l /tmp/SA.log | /usr/sbin/exim -oMr spam-scanned -i -f $SENDER $RCPT
~~~~~~~~~~~~~~~~~

I don't know what $SENDER is for, I didn't see it used anywhere in the
perl script, but it was set there. I can run this as root and pipe a
message to it, and it works. (it must be run as a "privileged" user
to set the received_protocol to prevent loops)

The relevant portions of my exim.conf are :

~~~~~~~~~~~~~~~~~
# Spam Assassin
spamcheck:
    driver = pipe
    command = "/usr/local/bin/spamcheck.sh ${sender_address} ${pipe_addresses}"
    prefix =
    suffix =
    check_string =
    escape_string =
    return_path_add = false
    # must use a privileged user to set $received_protocol on the way back in!
    user = mail
    group = mail
    current_directory = "/tmp"
    path = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
    # !!!!!!!!!!!!!!!!!!!
    return_output = false
~~~~~~~~~~~~~~~~~
# Spam Assassin
spamcheck_director:
    # only if the message hasn't been scanned yet
    condition = "${if eq {$received_protocol}{spam-scanned} {0}{1}}"
    driver = smartuser
    transport = spamcheck
~~~~~~~~~~~~~~~~~


However when I tell exim to run this automatically, I get the
following error message sent back to me :

~~~~~~~~~~~~~~~~~~~~~~~`
Received: from mail by dman.ddts.net (Exim 3.33 #1 (Debian))
>-------protocol: spam-scanned
>-------id 16Qfjm-0001Gq-00
>-------for <dman@???>
>-------; Tue, 15 Jan 2002 21:23:39 -0500

Message-Id: <E16Qfjm-0001Gq-00@???>
From: bounce-debian-user=dsh8290=rit.edu@???
To: dman@???
Date: Tue, 15 Jan 2002 21:23:39 -0500

Failed to create user preferences file
"/.spamassassin.cf" from default "/etc/spamassassin.prefs".
Failed to create default prefs file /.spamassassin.cf
~~~~~~~~~~~~~~~~~~~~~~~`

(if I set return_output to false it doesn't come back to me, but that
is like using a band aid to cover up a wound)

My questions are as follows :

1) Why is spamassassin trying to create a preferences file in /?

2)  How can users have their own preferences files?  It doesn't seem
    possible with this setup since either SA is run as 'mail' or every
    user on the system must be 'privilege'.


TIA,
-D

--

The fear of the Lord leads to life:
Then one rests content, untouched by trouble.
        Proverbs 19:23