Re: [exim] Help with RegExp

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Jeremy Harris
Date:  
À: exim-users
Sujet: Re: [exim] Help with RegExp
On 21/04/2021 07:39, Luca Bertoncello via Exim-users wrote:
> warn  set acl_m_from   = ${domain:${sg {$h_from:} {^\N(.*)?\<(.*)?\>$\N} {\$1}}}


> Unfortunately, if the FROM-Header contains a comma (eg: "Tester, Test <test.tester@???>") it fails.
> acl_m_from is empty


# exim -d-all+expand -be
[...]
> FOO=Tester, Test <test.tester@???>

Defined macro 'FOO'
> ${domain:${sg {FOO} {^\N(.*)?\<(.*)?\>$\N} {\$1}}}

  ╭considering: ${domain:${sg {Tester, Test <test.tester@???>} {^\N(.*)?\<(.*)?\>$\N} {\$1}}}
   ╭considering: ${sg {Tester, Test <test.tester@???>} {^\N(.*)?\<(.*)?\>$\N} {\$1}}}
    ╭considering: Tester, Test <test.tester@???>} {^\N(.*)?\<(.*)?\>$\N} {\$1}}}
    ├──expanding: Tester, Test <test.tester@???>
    ╰─────result: Tester, Test <test.tester@???>
    ╭considering: ^\N(.*)?\<(.*)?\>$\N} {\$1}}}
    ├──expanding: ^\N(.*)?\<(.*)?\>$\N
    ╰─────result: ^(.*)?\<(.*)?\>$
    ╭considering: \$1}}}
    ├──expanding: \$1
    ╰─────result: $1
    ╭considering: $1
    ├──expanding: $1
    ╰─────result: Tester, Test
   ├──expanding: ${sg {Tester, Test <test.tester@???>} {^\N(.*)?\<(.*)?\>$\N} {\$1}}
   ╰─────result: Tester, Test
  ├──expanding: ${domain:${sg {Tester, Test <test.tester@???>} {^\N(.*)?\<(.*)?\>$\N} {\$1}}}
  ╰─────result:


>




--
Cheers,
Jeremy