Re: [EXIM] Spam filters and long lines in configure file

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Paul Mansfield
CC: exim-users
Subject: Re: [EXIM] Spam filters and long lines in configure file
On Mon, 23 Feb 1998, Paul Mansfield wrote:

Quick reply, as I've gotta dash...

> I've studied the manuals and looked through the archives and can't find
> what I'm looking for. Maybe I was too brain-dead from sendmail manuals...
>
> I'm using Exim1.82 on Sparc Solaris 2.5 wih patches, Ultra/1 with plenty
> of memory and disk, a test machine.
>
> I want to have two types of spam rejection, by author and by host.
>
> ----1----
> If I block on the author using "sender_reject_recipients = ", it works if I
> simple add things to the line, e.g.
>    sender_reject_recipients=xyz@???:abc@???:money.com

>
> But I find that exim won't allow lines longer than 1024 characters, and dies
> if I have too long a line and "kill -HUP" it.


Should be possible to specify it as

        sender_reject_recipients="xyx@???:\
                                  abc@???:\
                                  ...
                                  "


> So, I decided to use an external file, i.e.
>    sender_reject_recipients = lsearch:/opt/exim/etc/spamblock-authors

                                          ^
                          I hope you had a semicolon here...                


> but can only make it work if the file contains one long string of
> name:name:name etc, and once the string reaches 1024 bytes long it stops
> working again.


That shouldn't work! An lsearch file has a list of names, one per line,
like an alias file. (It just doesn't use the "data" in this kind of
lookup.)

> ----2----
> To block on the host I've used
>    sender_host_reject_recipients = 1.2.3.4:8.9.10.11
> and this is fine, but suffers from the problem above, namely the maximum string
> length of 1024 chars. I've had no luck at all in trying to make it refer to
> an external file using lsearch.


Similar remarks, but in addition, there is a current lack of any way at
the moment to do lookup searching on IP addresses or partial addresses.
However, you can do a *linear* search on net lists.

> I'm sure Exim really *is* capable of doing what I want, so far it looks really
> good. If only our spam filters weren't so huge (we think that using Exim
> with all the right options will make maintenance of our filters much easier!)


We use these forms of sender filter:

# Blocks by IP address are now in a separate file.

sender_net_reject_recipients = /etc/mail/exim/net_reject_list

# The main spam list is maintained by the postmasters. We would like to block
# all-digit local parts of more than 8 digits. Sadly, there are some genuine
# 8-digit addresses in use. Handle these with an exception list.

  sender_reject_recipients = "@@lsearch*;/etc/mail/exim/sender_reject_bydomain:\
    ^\\d{8,}@"


where /etc/mail/exim/net_reject_lis contains lines like

1.2.3.4/32
4.5.6.7/16
...

and the reject_bydomain file contains stuff like

*                               YES!:BELIEVE.IT!:willhemina:MagiMail:.....
terra.cyberspc.mb.ca        dalrex:>*
shaw.wave.ca            mall:>*
kustom.on.ca            freedom:wally:>*
lindsaycomp.on.ca        ross:>*


and is actually built by a Perl script from a file of individual
addresses (which have comments and reasons attached, etc.)

Philip

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714



--
*** Exim information can be found at http://www.exim.org/ ***