Mailing List Archive

[Bug 3041] Error on ${run{/usr/bin/echo ${quote:hello world}}}
https://bugs.exim.org/show_bug.cgi?id=3041

Jeremy Harris <jgh146exb@wizmail.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |INVALID

--- Comment #1 from Jeremy Harris <jgh146exb@wizmail.org> ---
Working as documented:

"If the option preexpand is not used, the command string is split into
individual arguments by spaces and then each argument is expanded."

So you had "${run{/usr/bin/echo" as the first argument of the
command string, and that has no closing braces.

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

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
[Bug 3041] Error on ${run{/usr/bin/echo ${quote:hello world}}} [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=3041

--- Comment #2 from Lena <Lena@lena.kiev.ua> ---
The problem is the blank between "hello" and "world". Without "preexpand" the
string is split to arguments before expansion. Arguments:

/usr/bin/echo
${quote:hello
world}

My workaround:

set acl_m_shargs = echo $acl_m_user \
>>$spool_directory/blocked_users; \
{ echo Subject: user $acl_m_user blocked; echo; echo because \
has sent mail to LIM invalid recipients during PERIOD.; \
} | $exim_path -f root WARNTO
continue = ${run{SHELL -c "$acl_m_shargs"}}

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

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
[Bug 3041] Error on ${run{/usr/bin/echo ${quote:hello world}}} [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=3041

Andreas Metzler <eximusers@bebt.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|INVALID |---
Status|RESOLVED |REOPENED

--- Comment #3 from Andreas Metzler <eximusers@bebt.de> ---
(In reply to Jeremy Harris from comment #1)
> Working as documented:
>
> "If the option preexpand is not used, the command string is split into
> individual arguments by spaces and then each argument is expanded."
>
> So you had "${run{/usr/bin/echo" as the first argument of the
> command string, and that has no closing braces.


If that is what happens there is misparsing at an earlier stage:
Matching
${run <options> {<command arg list>}{<string1>}{<string2>}}
onto
${run{/usr/bin/echo ${quote:hello world}}}

yields <options>, {<string1>} and {<string2> as empty or missing and a
"<command arg list>" of "/usr/bin/echo ${quote:hello world}".

It does not make a difference whether this <command arg list> is expanded after
or before splitting.

Another proof of something fishy going is that setting the "preexpand" option
which is supposed to bring back the old behavior does not help.

cu Andreas

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

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
[Bug 3041] Error on ${run{/usr/bin/echo ${quote:hello world}}} [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=3041

Lena <Lena@lena.kiev.ua> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WORKSFORME
CC| |Lena@lena.kiev.ua
Status|REOPENED |RESOLVED

--- Comment #4 from Lena <Lena@lena.kiev.ua> ---
After or before matters:

# exim -be '${run,preexpand{/bin/echo ${quote:hello world}}}'
hello world
# exim -be '${run{/bin/echo ${quote:hello world}}}'
Failed: Expansion of "${quote:hello" from command "/bin/echo ${quote:hello
world" in ${run} expansion failed: missing } at end of string

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

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: [Bug 3041] Error on ${run{/usr/bin/echo ${quote:hello world}}} [ In reply to ]
On Wed, 25 Oct 2023, Exim Bugzilla via Exim-dev wrote:

> https://bugs.exim.org/show_bug.cgi?id=3041
>
> Andreas Metzler <eximusers@bebt.de> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Resolution|INVALID |---
> Status|RESOLVED |REOPENED
>
> --- Comment #3 from Andreas Metzler <eximusers@bebt.de> ---
> (In reply to Jeremy Harris from comment #1)
>> Working as documented:
>>
>> "If the option preexpand is not used, the command string is split into
>> individual arguments by spaces and then each argument is expanded."
>>
>> So you had "${run{/usr/bin/echo" as the first argument of the
>> command string, and that has no closing braces.
>
>
> If that is what happens there is misparsing at an earlier stage:
> Matching
> ${run <options> {<command arg list>}{<string1>}{<string2>}}
> onto
> ${run{/usr/bin/echo ${quote:hello world}}}
>
> yields <options>, {<string1>} and {<string2> as empty or missing and a
> "<command arg list>" of "/usr/bin/echo ${quote:hello world}".
>
> It does not make a difference whether this <command arg list>
> is expanded after or before splitting.

Splitting
"/usr/bin/echo ${quote:hello world}"
gives
"/usr/bin/echo" "${quote:hello" "world"
exanding that gives a syntax error.

Expanding
"/usr/bin/echo ${quote:hello world}"
gives the moral (not textual) equivalent of
"/usr/bin/echo hello&nbsp;world"
which splits as
"/usr/bin/echo" "hello world"

> Another proof of something fishy going is that setting
> the "preexpand" option which is supposed to bring back
> the old behavior does not help.

AIUI Lena demonstrated the original behavior with preexpand.

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
[Bug 3041] Error on ${run{/usr/bin/echo ${quote:hello world}}} [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=3041

--- Comment #5 from Andreas Metzler <eximusers@bebt.de> ---
Thanks for handholding and further explanations.

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

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@lists.exim.org
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/