Re: [Exim] Lsearch by IP

Etusivu
Poista viesti
Vastaa
Lähettäjä: Nico van der Dussen
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [Exim] Lsearch by IP
Hi I checked the code again - I made a booboo when copying - but that
did not solve the problem - same error still exists.

There seems to be a missng bracket in the last line of Philip's code.
But the error continues when I add the bracket.

I inserted spaces between "lsearch", "lsearch*" and the rest of the
equation - but it did not work.

Herewith my code as is now:

smtp_accept_max_per_host =
${lookup{$sender_host_address}lsearch{/path/to/file}\
                      {$value}\
                     {\


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



I'm at a loss :-))

Thanks

Nico


On 23 Apr 2003 at 18:29, Nico van der Dussen wrote:

> 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
> ___________________________________
>
>
>
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/ ##
>
>



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