Re: [Exim] check host_accept_relay from script?

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Dave C.
Data:  
Para: Philip Hazel
CC: exim-users
Assunto: Re: [Exim] check host_accept_relay from script?
On Tue, 27 Feb 2001, Philip Hazel wrote:

> On Tue, 27 Feb 2001, Dave C. wrote:
>
> > I need the "Is this IP address contained within any of the Network/Mask
> > specifications given" concept that (i think) exim does with net-lsearch
> > in host lists..
>
> No, I'm afraid net-lsearch doesn't do that. Because it is a lookup, it
> must end up with *one literal key* with which to search. So:
>
> net-lsearch        uses the IP address
> net25-lsearch      uses the address masked to 25 bits

>
> etc. Remember, this has to work for net-dbm, net-cdb, etc as well. This
> is one of the basic conceptual difficulties with Exim, I find. Everybody
> stumbles over this one, it seems. I wish I could find a good way of
> making the point that a lookup is a probe for a single, fixed key. Even
> if it happens to use lsearch as its search method.
>
> So in fact I lied in my previous message (see - even I stumble too!) It


But Phil! We thought you were infallible..

> would *not* work with net-lsearch. The only way to get your file to work
> for host_accept_relay would be without a search type at all, so that
> it acts as an interpolated list. This is just a list with some of it
> stored in a file instead of inline.


Yeah.. A lookup isn't want I want then. I want to duplicate however exim
decides whether a given host matches a host list that includes IP
network/mask pairs.. Perhaps somehow that code could be made available
through an expansion?

I guess I'll manage for what I'm doing with a simulated SMTP session
with -bh, but it would be nice if there were a more direct way of doing
this..

>
> > Hrm.. I suppose I could use exim -d9 -bh and somehow try
> > and parse the output, which, awkward tho it might be, is still closer to
> > the 'would exim permit relay for this IP address' which is really the
> > question I want to be able to answer..
>
> Use -bh if you want to go that route.