[exim] Re: Completely remove any name in From: header for in…

Pàgina inicial
Delete this message
Reply to this message
Autor: Victor Ustugov
Data:  
A: Slavko via Exim-users
Assumpte: [exim] Re: Completely remove any name in From: header for inbound email?
Slavko via Exim-users wrote on 27.05.2023 14:00:
> Ahoj,
> 
> Dňa Sat, 27 May 2023 13:20:48 +0300 Victor Ustugov via Exim-users
> <exim-users@???> napísal:
> 
>> I think that in this case it is not necessary to use a very "horrible
>> complicated" full RFC compliant regexp. It may be sufficient to ignore
>> all parenthesized text after the last ">". Or even ignore all text in
>> parentheses after the last ">".
>>
>> ${if
>> eq{${addresses:$rh_From:}}{}{${sg{$rh_From:}{\N^.*<(\S+?@\S+?)>[^>]*$\N}{\$1}}}{${addresses:$rh_From:}}}
>>
> 
> And then you get something as this:
> 
>     From: "postmaster@???" <charles@???> (<confuse@???>)
> 
> :-)))


In this case, everything will be fine, because the address will be
returned by ${addresses:...}

But there will be problems with such header:

From: postmaster@??? <charles@???>
(<confuse@???>)

> My point was, that regex can be not reliable too.


Regex is only a workaround. It is needed only because ${address:...} and
${addresses:...} cannot always extract the addresses from the headers.


> I consider the ${address:} expansion as way to prevent needing that
> anyone have to develop own parser, which can end in ugly or even wrong
> way as not all (including me) are regex experts...


> I do not expect, that ${address:} will parse any wrong syntax. I can
> accept, that it can fail in some corner cases of valid syntax. But
> i expect, that when header will pass the header_syntax check, then that
> expansion will be able to parse it, otherwise something is wrong.



--
Best wishes Victor Ustugov
mailto:victor@corvax.kiev.ua
public GnuPG/PGP key: https://victor.corvax.kiev.ua/corvax.asc

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