Re: [Exim] Lsearch by IP

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Nico van der Dussen
Datum:  
To: exim-users
Betreff: Re: [Exim] Lsearch by IP
Hi Philip,

thanks for your response.

I've tried it and I get the following error message:

expansion of smtp_accept_max_per_host failed for host
196.23.162.178: missing lookup type

I don't know why :-))

I've taken your code and commented it to see if I do understand what
I'm doing with this ( these comments are not in my config file)

smtp_accept_max_per_host =
${lookup{$sender_host_address}lsearch{/path/to/file}\  # Lookup
                      {$value}\            # If success,
return with this value
                      {\   # if fail, do this masked
wildcard search.


${lookup{${mask:$sender_host_address/24}lsearch*/path/to/file}}\
                      }}



Thanks

Nico

PS: The more I read the manual, the more I learn :-))
On 23 Apr 2003 at 9:52, Philip Hazel wrote:

> On Tue, 22 Apr 2003, Nico van der Dussen wrote:
>
> > I would like to do an lsearch* on IP-numbers from a file for the
> > smtp_accept_max_per_host command (using Exim 4.14)
> >
> > >From the manual I gather that the lookup must be
> > smtp_accept_max_per_host =
> > ${lookup{$sender_host_address}lsearch*{/path/to/file}}
> >
> > The file should contain lines like
> >
> > 123.111.222.123:4
> > *:1
> >
> > Now the big thing I'm not sure about: How do I handle say
> > 123.111.222.0/24 blocks of IP's?
> >
> > It does not seem right from the manual to add a line
> >
> > 123.11.222.0/24:2
> >
> > to the search file
>
> That will only work if you replace $sender_host_address with
> ${mask:$sender_host_address/24} in the lookup. But the lookup will not
> then find the other entries. What you need is a double lookup.
> Something like this:
>
>
> smtp_accept_max_per_host = \
> ${lookup{$sender_host_address}lsearch{/path/to/file}\
> {$value}\
> {\
> ${lookup{${mask:$sender_host_address/24}lsearch*{/path/to/file}}\ }}
>
> Note that the first one does *not* have the * on the search type. If
> you have blocks of different sizes (/24, /26, etc) you will have to
> configure it to do a separate lookup for each size.
>
> --
> Philip Hazel            University of Cambridge Computing Service,
> ph10@???      Cambridge, England. Phone: +44 1223 334714.

>
>



www.vddi.co.za___________________________
N van der Dussen
VDDi
Posbus 13488, CLUBVIEW, RSA, 0014
Tel +27 12 663-2710
Faks +27 12 663-2808
___________________________________