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

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Victor Ustugov
日付:  
To: Slavko via Exim-users
題目: [exim] Re: Completely remove any name in From: header for inbound email?
Slavko via Exim-users wrote on 27.05.2023 02:44:
> Dňa 26. mája 2023 22:31:56 UTC používateľ Victor Ustugov via Exim-users <exim-users@???> napísal:
>
>>
>> ${if
>> eq{${address:$rh_From:}}{}{${sg{$rh_From:}{\N^.*<(\S+?@\S+?)>\s*\N}{\$1}}}{${address:$rh_From:}}}
>>
>
> Thanks, but do you know that is not perfect too? Eg. try
> add "(comment)" after address and will match invalid
> address...


Oh... I really missed the "comment". Maybe because in real life I met it
a very long time ago.

> Some time ago i search email address regex
> on Internet, and what i found as full RFC compliant
> was horrible complicated, with questionable performance,
> not manageable (i lost in it) and for ASCII only...


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:}}}

>> But he can't do it either:
>>
>> From: postmaster@??? <charles@???>
>
> That is IMO OK, as this will not pass header_syntax check,
> thus one can consider that as expected to don't parse...



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