Re: What is my mistake in understaning the included paragraph from the spec?
Jeremy Harris via Exim-users <[email protected]> Wed, 29 Apr 2026 09:28:45 +0100
| Newsgroups | gmane.mail.exim.user |
|---|---|
| Message-ID | <[email protected]> |
On 2026/04/29 2:54 AM, u34--- via Exim-users wrote:
> The following is copied from
> https://exim.org/exim-html-current/doc/html/spec_html/ch-file_and_database_lookups.html#SECID60
> with one exception.
>
> ---> Start of qoute
> 1. Examples of different lookup syntax
> ======================================
> It is easy to confuse the two different kinds of lookup, especially as the lists that may contain the second kind are always expanded before being processed as lists. Therefore, they may also contain lookups of the first kind. Be careful to distinguish between the following two examples:
>
> I) domains = ${lookup{$sender_host_address}lsearch{/some/file}}
> II) domains = lsearch;/some/file
> ---> End of qoute
>
> The exception in copying, compared to the text in the web site, is the addition
> of the prefixes I) and II) at the begining of the last two lines.
>
> The way I read this text, it reads
> lists that may contain
> lsearch;/some/file
> are always expanded before being processed as lists. Therefore, they may
> also contain lookups of the form
> ${lookup{$sender_host_address}lsearch{/some/file}}
Almost. Actually, the intent is:
"lists (that may contain the second kind) are always expanded before being processed as lists"
i.e:
"lists are subjected to string-expansion before being processed as lists"
All lists. Not some special class of lists.
>
> Doesn't that contradicts some lines from the documentation that follows? Namely,
>
> ---> Start of qoute
> In the second example, the lookup is a single item in a domain list. It causes Exim to use a lookup to see if the domain that is being processed can be found in the file. The file could contains lines like this:
>
> domain1:
> domain2:
>
> Any data that follows the keys is not relevant when checking that the domain matches the list item.
> ---> End of qoute
>
> If any data that follows the keys is not relevant when checking that the domain
> matches the list item, how it
>
> may also contain lookups of the form
> ${lookup{$sender_host_address}lsearch{/some/file}}
Because all lists are subjected first to string-expansion. Any data resulting from a <searchtype>;
lookup done as a result of the second, list-component interpretation, phase of process of the list
is not available at the time of the first, string-expansion, phase.
--
Cheers,
Jeremy
--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## [email protected]
## Exim details at https://www.exim.org/
## Please use the Wiki with this list - https://code.exim.org/exim/wiki/wiki