Mailing List Archive

Assistance requested with $if foray{...
Hi, all,


I want to search a file for decreasingly specific forms of an address that come from a given host and do some specialist routing thereafter. To this end I have constructed the following confition:

condition = ${if forany{ \
$local_part@$domain:$local_part@:$domain: :} \
{bool_lax{ \
${lookup{${item}@$sender_host_name}dbm{/opt/exim/table.db-exim-admin}
}
}
}

This seems to do what I want to do. But now I want to change this to be the subject of data = and I cannot find a way to get the $value of the first look up that succeeds as it get squashed by the bool_lax which seems is needed.

Can anyone advise how to get this?

I want to have the touter's data = $[if forany{... where is searches through the file in the order givn in the for any above finding the first one listed so I can have

exim@domain@host-abc: recipient1@domain1.com
exim@@host-abc: recipient2@domain2.com
domainA@host-abc@ recipient3@domain3.com

so that I can be as specific or in specific as I choose with a heirarchy which get the most specific match.


Regards och Kittos


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Assistance requested with $if foray{... [ In reply to ]
On 2018-04-18 at 11:42 +0000, Robert Bannocks via Exim-users wrote:
> I want to search a file for decreasingly specific forms of an address
> that come from a given host and do some specialist routing thereafter.
> To this end I have constructed the following confition:

Can you change the stored format at all? So that you have *@example.org
stored instead of just example.org ? How important is the domainless
matching, and it being used in the same Router, instead of two different
Routers, given that usually mail addresses are per-domain?

https://www.exim.org/exim-html-current/doc/html/spec_html/ch-file_and_database_lookups.html#SECTdefaultvaluelookups

See how you'd use >> dbm*@ << instead of >> dbm << for matching; and see
subsequent sections of the documentation for other things which can be
done.

Consider also use of multiple Routers all using the same Transport.

Consider if you might be better served for at least one of those using
the local_parts precondition option with a query-style lookup, instead
of a condition option with a single-key lookup.

-Phil

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/