https://bugs.exim.org/show_bug.cgi?id=3101
Bug ID: 3101
Summary: allow for list range to be extracted in listextract
function
Product: Exim
Version: 4.98
Hardware: x86-64
OS: Linux
Status: NEW
Severity: wishlist
Priority: medium
Component: String expansion
Assignee: unallocated@???
Reporter: help@???
CC: exim-dev@???
Please add a listextractrange function to give users the power of Exim's list
handling:
${listextractrange{
[-]$offeset}
[{$limit} optional, if omitted -> until end]
{ [>$output_delimiter, by default same as $input_delimiter] [<$input_delimiter]
$subject }
}
${lookup{${listextractrange{1}{<.$tls_in_sni}}}dsearch{/some/path/to/domains}{$value}{some_default_value}}
this would allow to strip the first subdomain of a domain very easily and use
the power of Exim's list handling as output. Currently the only way to achieve
a similar result would be:
${lookup{${substr{${strlen:${listextract{1}{<.$tls_in_sni}{$value.}}}}{$tls_in_sni}}}dsearch{/some/path/to/domains}{$value}{some_default_value}}
Here we extract the first sub-domain, add a dot at the end, measure its length
through strlen and use that to cut the target string off via substr. This
solution however is sub-optimal since Exim removes unnecessary
(leading+trailing) white-spaces on each element in a list. So the offset could
potentially be distorted by leading white-spaces.
Generally it would be a great benefit for Exim users to have a more powerful
tool at their hands for dealing with lists. Such a function would have many
potential use-cases, not only in connections with domains.
Thank you very much for your consideration as well as the attention.
--
You are receiving this mail because:
You are on the CC list for the bug.
--
## subscription configuration (requires account):
##
https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@???
## Exim details at
http://www.exim.org/
## Please use the Wiki with this list -
http://wiki.exim.org/