On 2023-04-12 17:42, Slavko via Exim-users wrote:
Dňa 12. apríla 2023 16:50:29 UTC používateľ MRob via Exim-users
<exim-users@exim.org> napísal:
Hi, I have a variable to extract the email address in from header set like this:

${lc:${address:$h_From:}}

Header is valid, but after decoding it contains comma without
qoutes, the comma is address separator and thus results in
list of two "addresses", first without valid address, thus empty...

Use raw header for address extracting -- $rh_From: that works
for both, quoted and encoded content...

thank you Slavko!

If using rh_From: is there risk to get tricked with header like:

From: "spammer_addr...@example.bad" <compromised_acco...@example.com>

${address:} expansion is following RFC 2822... so maybe its ok and the importance is $h_ should never be used with ${address:} because that address expansion will decode it anyway??

Also question about $h_ decoding, I dont remember if quoting is required if it is encoded like my exmaple. Is the example a invalid header because it needs quoting? Or is the problem that i'm using two unrelated steps for full parsing? ($h_ then ${address:})

--
## 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/

Reply via email to