[Exim] Exim and SpamAssassin

Top Pagina
Delete this message
Reply to this message
Auteur: Rossz Vamos-Wentworth
Datum:  
Aan: exim-users
Onderwerp: [Exim] Exim and SpamAssassin
I have Exim 4.12 working nicely with SpamAssassin 2.43 very
nicely. However, there is one improvement I wish to make. If
someone is on a user's blacklist, I want to bounce the message
(preferably with a custom message) instead of sending it to my
spam box.

I assume I need to do a match before the spambox router.
Blacklist matches results in this in the header:

X-Spam-Status: Yes, hits=100.8 required=7.0
        tests=SPAM_PHRASE_00_01,USER_IN_BLACKLIST
        version=2.43


The keyword being "USER_IN_BLACKLIST". Any entry in the
blacklist adds 100 to the spam score. I'm still fairly new at exim so
I'm not sure how to handle this. Any suggestions would be
appreciated.


Here's my relevant Exim configuration:

begin routers

.... clipped

# Spam Assassin
spamcheck_router:
no_verify
check_local_user
# When to scan a message :
# - it isn't already flagged as spam
# - it isn't already scanned
condition = "${if and { {!def:h_X-Spam-Flag:} {!eq
{$received_protocol}{spam-scanned}}} {1}{0}}"
driver = accept
transport = spamcheck

spambox:
driver = accept
# route to the spambox if 15 or more "hits"
condition = ${if match {$header_X-Spam-Level:} {\\*{15\}} {1}{0}}
transport = spambox_delivery

... clipped

begin transports

... clipped

spamcheck:
    driver = pipe
    command = /usr/exim/bin/exim -oMr spam-scanned -bS
    use_bsmtp = true
    transport_filter = /usr/bin/spamc -u ${local_part}
    home_directory = "/tmp"
    current_directory = "/tmp"
    # 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
    return_path_add = false
    message_prefix =
    message_suffix =


spambox_delivery:
driver = appendfile
user = spam
file = /var/mail/spam
current_directory = /
delivery_date_add
envelope_to_add
return_path_add

... clipped