RE: [exim] bounce per lang

Top Page
Delete this message
Reply to this message
Author: Herb Martin
Date:  
To: exim-users
Subject: RE: [exim] bounce per lang
> [mailto:exim-users-bounces@exim.org] On Behalf Of Fred Viles
> On 7 Sep 2005 at 12:10, Jason Morehouse wrote about
>
> | We're getting a large amount of Russian spam. Well... I think it's
> | spam... but can't really read it! :)
> |
> | Anyway, what's the best way to bounce message per language.. or
> | character set I would guess. We're using exim 4.43.
> "Bounce" is a dirty word. I'll assume you mean "reject". ;)


Correct!

> The easiest way to do this is with the exiscan patch (if you
> haven't already applied the patch, best to upgrade to 4.52).
> For example, I have the following stanza in my MIME ACL:
>
>   deny    message        = Sorry, emails must be in english \

<snip>
>     mime_regex    = \N[\x80-\xff]\N


> The mime_regex condition is to check for there actually being
> some non-ASCII characters in the message body, as we get
> legitimate email from asian sources written in english.


Excellent, I will perhaps add that condition to my version,
which using a condition on SpamAssassin.

While mine is not the simplest it has more charsets,
uses SpamAssassin to decide if it is safe(r) to reject,
and also checks more headers:

We get no legitimate Russian email but do get quite
a bit of Arabic, Spanish (and some) Hebrew, French,
German -- so far we have identified no false positives
(for us) with this.

Macro in main section:

BAD_CHARSETS = \\s*=\\?(ks_c_5601-|big5|euc-|\
              shift-jis|(iso.\{0,4\}639-)|hkscs|sil|koi[78]|\
              iscii|guobiao|gb2312|gb18030|(iso.\{0,4\}2022)|\
              (iso.\{0,4\}8859-[57])|(windows-1251))


Stanzas for Data ACL (there two merely to make it
easier for me to monitor the firing of each separately
with different messages):

deny       message = Unreadable character set encoding  [$acl_m1].
    !authenticated = *
         condition = ${if <{$message_size}{MAX_SPAM_SIZE}{1}{0}}
          !senders = :
              spam = herbm/defer_ok
         condition = ${if def:h_content-type:}
        set acl_m1 = ${if or {\
                      {match {${lc:$h_content-type:}}  {BAD_CHARSETS}}\
                {match {${lc:$rh_content-type:}}
{BAD_CHARSETS}}\
               }{$0}{}}
         condition = ${if eq{$acl_m1}{}{false} {true}}
       log_message = listed unreadable charset encoding  [$acl_m1].


deny       message = Unreadable character set encoding2 subject [$acl_m1].
    !authenticated = *
         condition = ${if <{$message_size}{MAX_SPAM_SIZE}{1}{0}}
          !senders = :
              spam = herbm/defer_ok
        set acl_m1 = ${if or {\
                      {match {${lc:$h_subject:}}  {BAD_CHARSETS}}\
                      {match {${lc:$rh_subject:}} {BAD_CHARSETS}}\
               }{$0}{}}
         condition = ${if eq{$acl_m1}{}    {false} {true}}
       log_message = listed unreadable charset encoding2 subject [$acl_m1].


--
Herb Martin
HerbM@??? http://LearnQuick.Com
512 388 7339 -or- 1 800 MCSE PRO
Accelerated MCSE in a Week Seminars