Re: [Exim] SPAM TAG after RBL'ed

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Jez Hancock
Ημερομηνία:  
Προς: Exim Users List
Αντικείμενο: Re: [Exim] SPAM TAG after RBL'ed
On Wed, Sep 24, 2003 at 12:32:58AM -0400, Oren Levi wrote:
> If i'm not mistaken this adds a header link named X-blacklisted.
>
> But how would you take the subject and add "* SPAM*" in front of it ?

Sorry my bad, misread your post.

I'm not sure how you can do that directly within Exim - I use
spamassassin (spamd) in conjunction with the exiscan-acl to scan all
inbound mail at DATA time as follows - during that process the message
data is scanned by spamassassin/spamd and 'marked up' or 'tagged' if it
scores over a certain threshold and the 'rewrite_subject' option is set.

What follows is the whole of my data acl:

-snip-
acl_check_data:

  # Check for dodgy attachments we don't want to accept:
  deny        message        = This message contains a MIME error ($demime_reason)
  demime                = *
  condition                = ${if >{$demime_errorlevel}{2}{1}{0}}


  deny        message        = This message contains an unwanted file extension \
                    ($found_extension) - if you really want to send a file of type \
                    $found_extension please consider sending it in a zipfile.
        demime = ade:adp:bas:bat:chm:cmd:com:cpl:crt:exe:hlp:hta:\
                 inf:ins:isp:js:jse:lnk:mdb:mde:msc:msi:msp:mst:\
                 pcd:pif:reg:scr:sct:shs:shb:url:vb:vbe:vbs:wsc:\
                 wsf:wsh



# spam stuff:
    # put headers in all messages (no matter if spam or not)
    warn  message = X-Spam-Score: $spam_score ($spam_bar)
        condition = ${if <{$message_size}{80k}{1}{0}}
        spam = nobody:true


    warn  message = X-Spam-Report: $spam_report
        condition = ${if <{$message_size}{80k}{1}{0}}
        spam = nobody:true


    # reject spam at high scores (> 8)
    deny   message = Message scored $spam_score > 8
        spam = nobody:true
        condition = ${if >{$spam_score_int}{80}{1}{0}}


    # add second subject line with *SPAM* marker when message
    # is over threshold
    warn log_message = spam:$spam_score:6
        condition = ${if <{$message_size}{80k}{1}{0}}
        condition = ${if >{$spam_score_int}{60}{1}{0}}
        spam = nobody:true


    accept
-snip-


From what I understand of this, when the message is passed to the spam
daemon, the subject may or may not be rewritten depending on how your
spamassassin configuration is setup. The 'rewrite_subject'
and 'required_hits' config options determine whether a subject is
rewritten. If 'rewrite_subject' is set to 1 and the message scores over
'required_hits' number of points, the message is rewritten.

FWIW my very simple config for SA looks like:

-snip-
# This is the right place to customize your installation of SpamAssassin.
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
###########################################################################
#
rewrite_subject 1
required_hits 6
use_razor1 0# don't bother, we use exim rbls
use_razor2 0# don't bother, we use exim rbls
skip_rbl_checks 1# don't bother, we use exim rbls
-snip-

Again I'm fairly new to all of this so reading needs to be done :)

References I found useful were the documentation that came with the
exiscan-acl patch (search the list, there's plenty of references to the
site!), this list itself and various examples scattered around and the
spamassassin documentation (especially manpages for spamd and
Mail::SpamAssassin::Conf mentioned above).

--
Jez

http://munk.nu/