Re: [exim] Exim 4.94 - error linear search

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jeremy Harris
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Exim 4.94 - error linear search
On 09/06/2020 12:15, Mikhail Golub via Exim-users wrote:
> 14:02:18 58064 --------> forwarding_router router <--------
> 14:02:18 58064 local_part=test domain=domain.com
> 14:02:18 58064 checking domains
> 14:02:18 58064 domain.com in "mx.mydomain :
> /usr/local/etc/exim/acl/virtual_domains"? yes (matched "domain.com" in
> /usr/local/etc/exim/acl/virtual_domains)
> 14:02:18 58064 data from lookup saved for cache for +virtual_domains:
> key 'domain.com' value ''
> 14:02:18 58064 domain.com in "+virtual_domains"? yes (matched
> "+virtual_domains")


Aha.

"When the domains option on a router matches a domain by means of a lookup, the data read by the lookup is available during the running of the router as $domain_data"

Your "virtual_domains" list is a pure list and does not do a lookup,
so $domain_data was not set...

> 14:02:18 58064 checking require_files
> 14:02:18 58064  ╭considering: /usr/local/etc/exim/domains/$domain_data
> 14:02:18 58064  ├──expanding: /usr/local/etc/exim/domains/$domain_data
> 14:02:18 58064  ╰─────result: /usr/local/etc/exim/domains/


so the require_files is only looking a a directory...

> 14:02:18 58064 file check: /usr/local/etc/exim/domains/$domain_data
> 14:02:18 58064 expanded file: /usr/local/etc/exim/domains/
> 14:02:18 58064 stat() yielded 0


which exists.

So that explains the require_files mystery as well as the problem
with the file for the later lookup.

A hack would be to replace the "/usr/local/etc/exim/acl/virtual_domains"
in virtual_domains with "lsearch,ret=key;/usr/local/etc/exim/acl/virtual_domains".
Since this is a lookup it returns data, which goes into $domain_data.
However, the file format is more restricted: only a real item per line
(previously, each line was a list item - so embedded named-lists
or lookups, were feasible).

That hack doesn't work for the first item of your list, though.
If you can't put that item into the same file, you might need to
duplicate that router and have one handling each of those list elements.
--
Cheers,
Jeremy