[exim-dev] [Bug 2929] New: Failed to expand $recipients afte…

Etusivu
Poista viesti
Vastaa
Lähettäjä: admin
Päiväys:  
Vastaanottaja: exim-dev
Uudet otsikot: [exim-dev] [Bug 2929] Failed to expand $recipients after running external command with ${run} in ACL
Aihe: [exim-dev] [Bug 2929] New: Failed to expand $recipients after running external command with ${run} in ACL
https://bugs.exim.org/show_bug.cgi?id=2929

            Bug ID: 2929
           Summary: Failed to expand $recipients after running external
                    command with ${run} in ACL
           Product: Exim
           Version: 4.96
          Hardware: x86-64
                OS: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: String expansion
          Assignee: unallocated@???
          Reporter: r.jenster@???
                CC: exim-dev@???


In exim 4.96 it is not possible to expand $recipients after running an external
command using the ${run} expansion. The expaned $recipients variable is empty.
This does not happen in exim 4.94 and 4.95.


You can check this with the following minimal config:


```
acl_smtp_predata = myacl
acl_smtp_rcpt = accept_all

begin acl

myacl:
        warn
                logwrite = before run: $recipients
                set acl_m0 = ${run{/bin/true}}
                logwrite = after run: $recipients


accept_all:
        accept
```


## Analysis
-----------

I tried to bisect the issue, and discovered that after reverting commit
https://git.exim.org/exim.git/commit/cfe6acff2ddc7eb03b3489770219edf829abd323
the $recipients variable is expanded again as expected.

So I digged a bit deeper.

The function transport_set_up_command is called for the string expansion of
${run {command}} in src/src/expand.c now enables argument expansion by default
here:

https://git.exim.org/exim.git/blob/cfe6acff2ddc7eb03b3489770219edf829abd323:/src/src/expand.c#l5593

But within the argument expansion in transport_set_up_command the global option
enable_dollar_recipients is disabled here

https://git.exim.org/exim.git/blob/cfe6acff2ddc7eb03b3489770219edf829abd323:/src/src/transport.c#l2349

While this may work for transports, it is not a good idea when ${run} is used
in ACLs.
Attached you'll find a patch that resets the global option
enable_dollar_recipients. This makes the expansion of $recipients work again.

--
You are receiving this mail because:
You are on the CC list for the bug.