Jasen Betts via Exim-users wrote on 13.04.2023 10:07:
> On 2023-04-12, Victor Ustugov via Exim-users <[email protected]> wrote:
>> Slavko via Exim-users wrote on 12.04.2023 20:42:
>>> Dňa 12. apríla 2023 16:50:29 UTC používateľ MRob via Exim-users 
>>> <[email protected]> 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...
>>
>>
>> What about the colon without encoding?
>>
>> From: =?utf-8?Q?My=20Bizness:=20Inc.?= <[email protected]>
> 
> yes, the colon breaks it. it's not a valid from header.

I know. But email clients correctly display the From header shown above.
And it is quite possible to get such a header in an incoming email.

> RFC5322 is a bit of a rabbit hole to dive into.
> 
> but the short story is none of these should be used in "bare" names 
> 
>   specials        =   "(" / ")" /        ; Special characters that do
>                       "<" / ">" /        ;  not appear in atext
>                       "[" / "]" /
>                     ":" / ";" /
>                       "@" / "\" /
>                     "," / "." /
>                     DQUOTE
> 
> except where there is specific permission given
> 
> 
> Easiest fix for the sender is to use quotes.
> 
> From: "=?utf-8?Q?My=20Bizness:=20Inc.?=" <[email protected]>

in order to insert double quotes, I need to separate the From header
into the address and the part of the header that comes before it. Why do
I need to add quotes if I have already determined which part of the
header is the address?


-- 
Best wishes Victor Ustugov
mailto:[email protected]
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

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