Re: [Exim] host lists and arbitrary host masks

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: Marc Haber
Cc: exim-users
Asunto: Re: [Exim] host lists and arbitrary host masks
On Fri, 25 Feb 2000, Marc Haber wrote:

> What I would like to have is a possibility to have a single
> host_reject_recipients file that can contain entries like these:
> |lucy.safins.or.jp: spam relay, RBL listed, abuse unresponsive. /mh 2000-02-18
> |202.103.134.0/26: spam relay, reverse DNS broken, no e-mail in APNIC DB /mh 2000-02-25
>
> Please note the /26 net mask in the second entry, I would like to
> reject mail from that entire network.
>
> Currently, I have
> |host_reject_recipients          = "+allow_unknown:lsearch;/etc/exim/host_reject_recipients:net-lsearch;/etc/exim/host_reject_recipients"

>
> Rejecting based on hostname works, but I can't figure out how to do
> the IP mask. I am aware of the net<number>-<searchtype> notation for
> host masks but I certainly don't want to do 33 lookups into the same
> file. There surely is a way to have this handled more easily. Maybe I
> am just missing something here.


Since you are prepared to scan your file linearly (I assume, therefore,
that it is not very big), you can just make it into an interpolated file
rather than a lookup:

host_reject_recipients = "+allow_unknown:/etc/exim/host_reject_recipients"

However, if you do that, you can't have anything other than host items
in the file, so your comments will have to go. The obvious way round
this is to have two files - one that you edit with comments, and another
that has the comments stripped. Use a script for updating that
automatically rebuilds the stripped one.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.