Re: [Exim] rejecting hosts, with cidr notation and customize…

Top Page
Delete this message
Reply to this message
Author: Rejo Zenger
Date:  
To: exim-users
Subject: Re: [Exim] rejecting hosts, with cidr notation and customized message
++ 30/11/02 20:43 +0100 - Rejo Zenger:
>>What I would like to have is a file with on each line an IP address or a
>>range of IP addresses in CIDR notation with some text. Incoming
>>connections that match should be rejected with the text as error
>>message.
>
>I'm very sorry, but after doing a more thorough search, it seems
><Pine.SOL.4.44.0211260904300.2540-100000@???> answers
>this question already.


The solution provided in that messages works, except for that one pair
of "{}" is missing. The correct syntact is:

  deny  message         = ${lookup {${mask:$sender_host_address/32}} lsearch {/etc/exim/blocked.ip}}
        hosts           = net32-lsearch;/etc/exim/blocked.ip


  deny  message         = ${lookup {${mask:$sender_host_address/24}} lsearch {/etc/exim/blocked.ip}}
        hosts           = net24-lsearch;/etc/exim/blocked.ip


  deny  message         = ${lookup {${mask:$sender_host_address/16}} lsearch {/etc/exim/blocked.ip}}
        hosts           = net16-lsearch;/etc/exim/blocked.ip


There's only one thing that I have a problem with. In this file with the
IP to reject and the error messages, how do I get a newline in the error
message? For certain IP ranges, I would like to give the exact reason
for rejecting the connection, along with some pointers to more extensive
information. It would be nice if this could be done in two lines. A
plain \n doesn't seem to work.

Thanks in advance.

--
Rejo Zenger <rejo@???>
http://www.xs4all.nl/~sister
PGP 0x75FC50F3