Re: [Exim] Protect again spam

Góra strony
Delete this message
Reply to this message
Autor: Oliver Egginger
Data:  
Dla: Bjoern.Arne.Ramann
CC: exim-users
Temat: Re: [Exim] Protect again spam
Hi there,

download the spamassassin package.
See
http://au.spamassassin.org/downloads.html

Define a router in your Exim configuration file.
For Exim 4 it could look like this:

# 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
  #   -   comes from ABC.DEF.GHI.JKL or MNO.PQR.STU.VWX
  #   -   .spamcheck exists for this user
  condition = \
  "${if and { {!def:h_X-Spam-Flag:} \
              {!eq {$received_protocol}{spam-scanned}} \
              {or { {eq {$sender_host_address}{ABC.DEF.GHI.JKL}} \
                    {eq {$sender_host_address}{MNO.PQR.STU.VWX}} \
                  }\
              }\
            }\
            {1}{0}\
    }"
  require_files = $home/.spamcheck
  driver = accept
  transport = spamcheck



This router has two advantages (for us):

1. You can define the sender host addresses from which you will
scan the spam.
In my example there are ABC.DEF.GHI.JKL and MNO.PQR.STU.VWX (you have to
substiute this by your real IP-Adresses).

2. The spamcheck router only runs in dependency of the existence of the
.spamcheck file.
So your users can decide whether or not they wont to use Spamassassin.
Thats important for protection of privacy in germany.

If you don't need this you can simplify the router, for example:

# 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



In the end you will need a spamcheck transport.
This one works well for us:

# Spam Assassin
spamcheck:
    driver = pipe
    command =  /usr/exim/bin/exim -oMr spam-scanned -bS
    use_bsmtp = true
    transport_filter = /usr/bin/spamc
    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 =



Put the router and the transport on the right places in your exim conf
and send the daemon a HUP signal.
Thats all.

- oliver


Am Die, 2003-05-20 um 22.56 schrieb Bjoern.Arne.Ramann@???:
> Hello together,
>
> i am looking for a way to protect against spam.
>
> We have some mail-realy systems, based on exim. To block spam, we use now
> filter-rules based on "subjecs" and some other fields.
>
> This works in some kinds, but is not really (in our config) effictive.
>
> Are there other ways to protec again spam?? I think that
> commercial-solutions will be OK when they work together with Exim.
>
>
> Reguards
> bjoern
>
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##


--
Oliver Egginger <Oliver.Egginger@???>
Giessen-Friedberg University of Applied Sciences
Wiesenstrasse 14
35390 Giessen
Tel. +49 641 309-1283
Fax +49 641 309-1288