Re: [Exim] check host_accept_relay from script?

Página Inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Para: Dave C.
CC: exim-users
Assunto: Re: [Exim] check host_accept_relay from script?
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
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.

> 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.


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