Re: [Exim] Host lists in string expansions?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Nico Erfurth
Datum:  
To: Dean Brooks
CC: exim-users
Betreff: Re: [Exim] Host lists in string expansions?
Dean Brooks wrote:
> Hi,
>
> Is it possible to look up values in a host list (or other list type)
> from a string expansion (running Exim 4.10)?
>
> Specifically, I have a file containing all our local networks, and
> the masks vary on each one (i.e. 1.1.1.1/24, 2.2.2.2/28, 3.3.3.3/20).
> This is assigned to a host list called "+localnets".
>
> Now, routers do not appear to have a "sender_host" check option that
> would allow me to exclude a router based upon source address.
>
> So, I was hoping to do something like:
>
> condition = ${isinhostlist {$sender_host_address}{+localnets}}
>
> ...but I can't find an appropriate function.
>
> The "mask" expansion won't seem to work since I have to know the
> mask width ahead of time. Host lists automatically interpret each
> item in the host list separately and auto-widen the search address
> for each comparison.
>
> Is there any way to do this?
>
> If not, my wish list item would be to either (a) have a sender_host
> check item on routers or (b) have some way to look up a key in
> a host/domain/address list in string expansions using normal
> list lookup methods.


An expansion-item for this is on the wishlist.

For now, you could use a "fake".

data_acl:
   warn message = X-Internal-Header: OK
        sender_host = /your/file


and check for the value of $h_x-internal-header: in your router-condition.

Or you "normalize" your hostmasks to the smallest mask you need, and use
a netMASK-lookup to test for it.

ciao.