[exim] Re: De-Tainting in a filter-file?

Página Inicial
Delete this message
Reply to this message
Autor: Niels Kobschätzki
Data:  
Para: Jeremy Harris, Jeremy Harris via Exim-users
Assunto: [exim] Re: De-Tainting in a filter-file?
> Jeremy Harris via Exim-users <exim-users@???> hat am 21.07.2023 11:25 CEST geschrieben:
>
>
> On 21/07/2023 09:39, Niels Kobschätzki via Exim-users wrote:
> > When I start to quote that it won't work. I tried '$h_From:' and wrapping ${address:$h_FROM:} and wrapping ${lc:${address:$h_From:}} but those resulted all in a deferral iirc because the search query was broken.
>
> Show the debug.
>
> > But maybe I understand quoting wrong in this context. Do you mean wrapping it in ' or do you mean using "quote_ldap"?
>
> The latter.


I set a header like this:
From: test blacklist <test-blacklist@???>

Without quote_ldap it results in an ldap-query that has this part:
ldap://...(|(mailBlackList=test-blacklist@???)...

I quoted now: (mailBlackList=${lc:${address:${quote_ldap:$h_From:}}})

And this results in an ldap-query with this part:
ldap://...(|(mailBlackList=%22test%20blacklist%22%20%3ctest-blacklist%40domain.tld%3e)

And this won't be found in the ldap because the actual ldap-entry is "test-blacklist@???".

I also tried
$bh_From: → %22test%20blacklist%22%20%3ctest-blacklist%40domain.tld%3e
$rh_From: → mailBlackList=%20%22test%20blacklist%22%20%3ctest-blacklist%40domain.tld%3e%0a

With quote_ldap I can't find a way to just extract "test-blacklist@???" from the "From:"-header. Without quote_ldap it works, but that is tainted.

Best,

Niels

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/