Re: [Exim] Spamassassin again

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: dman
Dátum:  
Címzett: Exim Users Mailing List
Tárgy: Re: [Exim] Spamassassin again
On Sun, Jan 20, 2002 at 09:07:11PM +0100, Stephane Leclerc wrote:
| Hi Folks,

|
| I installed spamassassin on a Debian Woody box following this page:

|
| http://bogmog.sourceforge.net/document_show.php3?doc_id=28

|
| Spmassassin 1.5 come direct from the .deb package. I'm using Exim 3.32.

|
| I curently have 2 problems: when the message comes from external, the


Need to see your config to know why.

| The following text was generated during the delivery attempt:

|
| ------ root@localhost ------
| Failed to create user preferences file
| "/.spamassassin.cf" from default "/etc/spamassassin.prefs".
| Failed to create default prefs file /.spamassassin.cf
| ------

|
| I tried to understand the messages on the exim-list about spamassassin but
| unfortunaly, I curently don't understand where come from the abowe message
| and how to solve my problems.


This is an annoying mis-feature of spamassassin. By default, the
first time it is run it tries to create $HOME/.spamassassin.cf by
copying the system's config (at that time). You probably have
spamassassin running as user 'mail' which has '/' as the home
directory, but can't create the "/.spamassassin.cf" file.

Here's the solution I have right now :

Transport section :

# Spam Assassin
spamcheck:
    driver = pipe


    command = "spamassassin -P | exim -oMr spam-scanned -i -f \"${if eq {${sender_address}}{} {mailer-daemon}{${sender_address}}}\" -- \"\\$LOCAL_PART\""
    #command = "spamc -f | exim -oMr spam-scanned -i -f \"${if eq {${sender_address}}{} {mailer-daemon}{${sender_address}}}\" -- \"\\$LOCAL_PART\""
    use_shell = true


    home_directory = "/etc/spamassassin"
    current_directory = "/tmp"


    # must use a privileged user to set $received_protocol on the way back in!
    user = mail
    group = mail


    path = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"


    # !!!!!!!!!!!!!!!!!!!
    #log_fail_output = true
    log_output = true
    return_fail_output = true
    #return_output = false


    prefix =
    suffix =
    check_string =
    escape_string =
    return_path_add = false



Directors Section :

# Spam Assassin
spamcheck_director:
    # When to scan a message :
    #   -   it isn't already flagged as spam
    #   -   it isn't already scanned
    #   -   it didn't originate locally (as long as I don't harbor spammers :-))
    condition = "${if and { {!def:h_X-Spam-Flag:} {!eq {$received_protocol}{spam-scanned}} {!eq {$received_protocol}{local}} } {1}{0}}"
    driver = smartuser
    transport = spamcheck



Also, on line 467 of /usr/share/perl5/Mail/Spamassassin.pm the
"create_default_prefs" subroutine begins. I commented out the entire
body of this routine (it is where the system conf is copied to the
user's home directory).


I'm working on getting the spamc/spamd combo working since it is
_much_ faster than running spamassassin separately for each message.

-D

--

Thy Word is a lamp unto my feet
and a light unto my path.
        Psalms 119:105