Re: [exim] $spam_score_int set during sender verification?

Top Page
Delete this message
Reply to this message
Author: Ted Cooper
Date:  
To: Martijn Grendelman
CC: exim-users
Subject: Re: [exim] $spam_score_int set during sender verification?
Martijn Grendelman wrote:
> Hi,
>
> I could use some clarification on the following issue. In my RCPT ACL, I
> have:
>
> deny    message         = Sender verification failed
>         !verify         = sender

>
> My first router is this:
>
> bounce_spam:
>         driver                  = redirect
>         domains                 = !+spam_domains
>         allow_fail
>         condition               = ${if >{$spam_score_int}{65}{1}{0}}
>         data                    = :fail: This message was classified as SPAM
>         repeat_use              = false

>
> This router bounces SPAM that was not stopped at SMTP time as a result
> of per-domain filtering settings.
>
> Now, today, some messages were refused with the following messages:
>
> 550-Verification failed for <masg44klim@???>
> 550-This message was classified as SPAM
> 550 Sender verification failed
>
> This indicates that routing during sender verification failed in the
> router mentioned above. My question: how could this happen? How could
> the $spam_score_int condition ever be true at this time, before any data
> is received and the 'spam' condition has not yet run?
>
> Now, I added 'verify = false' the router to prevent failure during
> verification, I hope this is sufficient.
>
> Best regards,
>
> Martijn Grendelman
>


That's not how it's usually set up ... where on earth did you pick up
that config?

http://www.exim.org/exim-html-current/doc/html/spec_html/ch41.html#SECID206
has all the correct details and you might be well of reading it to
understand a little bit more of what is going on.

To fix the problem, remove the entire "bounce_spam" router.

Next, find a nice place in your DATA ACL (acl_smtp_data = XXXXXXXX near
the top of your config file - if it doesn't exist... have a look at the
default config that comes with Exim), and put something like the
following in it .. "spamc" is whatever SA user you run under, or
whatever you set it to.

# Add X-Spam-Score header to every email regardless of score
  warn    message       = X-Spam-Score: $spam_score ($spam_bar)
          condition     = ${if <{$message_size}{80k}{1}{0}}
          spam          = spamc:true


# Add spam report to headers, but only if > 5.0
  warn    message       = X-Spam-Report: $spam_report
          condition     = ${if <{$message_size}{80k}{1}{0}}
          spam          = spamc:true
          condition     = ${if >{$spam_score_int}{50}{1}{0}}


# Tag the subject if SA thinks it's spam from its settings
  warn    message       = X-New-Subject: **SPAM** $spam_score $h_subject:
          condition     = ${if <{$message_size}{80k}{1}{0}}
          spam          = spamc


# Reject the mail if it's above 10.0
  deny    message       = Spam score too high
          log_message   = Spam score too high ($spam_score)
          condition     = ${if <{$message_size}{80k}{1}{0}}
          spam          = spamc:true/defer_ok
          condition     = ${if >{$spam_score_int}{100}{1}{0}}


The $spam_score_int variable is set when the spam = thingy is used.
This does all the spam reject type stuff at RCPT time and wont stuff up
your address verification.

I pulled this straight from my config, but now that I look at it, I may
have to review that part of it.

Ted
--
The Exim Manual
http://www.exim.org/docs.html
http://www.exim.org/exim-html-current/doc/html/spec_html/index.html