Re: [Exim] Spam Assassin, refining the config

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Marc MERLIN
日付:  
To: exim-users
新しいトピック: Re: [Exim] Current spamassassin config doesn't do it
題目: Re: [Exim] Spam Assassin, refining the config
On Wed, Mar 27, 2002 at 11:55:54PM -0800, Marc MERLIN wrote:
> So, if I were to put my system_aliases before this director, would it work
> without me needing to have a mapping of all the possible local_parts to a
> uid?
>
> To make sure I understand, if I put system_aliases first, it will cause
> aliases that deliver to a program not to be scanned, I can live with that.
> Aliases like this one:
> marc: mmerlin
> mmerlin: merlin
> would cause local_part to become merlin, which is my login, and wouldn't
> your transport then run with user being correctly set to merlin?


Actually, I think I found a better way to have spamassassin run for everyone
and yet allow users to have their own config:

I put my procmail director first, and have SA in /etc/procmailrc as
described in the documentation
While I don't know how to write:

# This director runs procmail for users who have a .procmailrc file
procmail:
driver = localuser
transport = procmail_pipe
require_files = ${local_part}:+${home}:+${home}/.procmailrc:+/usr/bin/procmail
or
require_files = ${local_part}:+${home}:+${home}/.spamassassin/user_prefs::+/usr/bin/procmail
no_verify

I can write two directors, one that tests for each file, but if I can have
only one, that'd be even better.

The trick is to then have the general spamcheck director after that, calling
this transport:
spamcheck:
    driver = pipe
    command = /usr/sbin/exim -oMr spam-scanned -bS
    transport_filter = /usr/bin/spamc -p 784
    bsmtp = all
    (...)


I do have to call spamc on with a different port because the procmail spamd
has to run with -F 1, and the transport spamd with -F 0

Now, my "only" problem is that messages that do go through the spamcheck
director lose the original envelope sender. That's very bad as far as I'm
concerned.
I don't know if there is a way to fix this using BSMTP

As an alternate  method, I tried to adapt an  earlier receipe (sp???) posted
here:
 original envelope sender.
# Spam Assassin
spamcheck:
    driver = pipe
    command = "/usr/sbin/exim -i -oMr spam-scanned -f ${if {eq {${sender_address}}{}} {mailer-daemon} {${sender_address}} } -- ${local_part}"
    transport_filter = /usr/bin/spamc -p 784
    home_directory = "/etc/mail/spamassassin"
    current_directory = "/etc/mail/spamassassin"
    # must use a privileged user to set $received_protocol on the way back in!
    user = mail
    group = mail
    log_output = true
    return_fail_output = true


but I'm definitely not good with exim syntax:
LOG: 0 MAIN PANIC
== marc@??? T=spamcheck defer (0): Expansion of "${if" from command "/usr/sbin/exim -i -oMr spam-scanned -f ${if {eq {${sender_address}}{}} {mailer-daemon} {${sender_address}} } -- ${local_part}" in spamcheck transport failed: condition name expected, but found ""

Any suggestions with either method?

And this is not over, my next plan is to have exim 4 reject SA tagged stuff
at SMTP time :-)

Marc
--
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking


Home page: http://marc.merlins.org/ | Finger marc_f@??? for PGP key