[exim] run{} string builder buggy?

Top Page
Delete this message
Reply to this message
Author: Cyborg
Date:  
To: Exim Mailing List
Subject: [exim] run{} string builder buggy?
Exim: 4.96 Fedorabuild

Hi,

I have this acl condition in use for years and it worked, but nowadays
it seems to fail:

  deny
    ...
    set acl_m9  = ${run{/usr/share/doc/perl-Mail-SPF/bin/spfquery $acl_m9}}
    condition   = ${if eq{$runrc}{1}{true}{false}}

for debugging I added

  warn log_message = "SPF TEST für --scope mfrom --id $sender_address
--ip $sender_host_address
  warn set acl_m9  = --scope mfrom --id $sender_address --ip
$sender_host_address
           set acl_m9  =
${run{/usr/share/doc/perl-Mail-SPF/bin/spfquery $acl_m9}}
           log_message = returncode {$runrc}

which gives us:

 Warning: "SPF TEST f\303\274r --scope mfrom --id X --ip Y
 Warning: returncode {255}

Wenn i run the resulting command in bash as exim I get:

# echo $?
1

which is the expected code for a spf fail, but in exim it is 255 because
of this:

 /usr/share/doc/perl-Mail-SPF/bin/spfquery "--scope mfrom --id X --ip Y"

instead of :

 /usr/share/doc/perl-Mail-SPF/bin/spfquery --scope mfrom --id X --ip Y

changing the config from:

  warn set acl_m9  = --scope mfrom --id $sender_address --ip
$sender_host_address
           set acl_m9  =
${run{/usr/share/doc/perl-Mail-SPF/bin/spfquery $acl_m9}}

to

  warn set acl_m9  = ${run{/usr/share/doc/perl-Mail-SPF/bin/spfquery
--scope mfrom --id '$sender_address' --ip '$sender_host_address'}}

Solved it.

The thought here is: Why was $acl_m9 escaped as it was inserted into
itself and i.e. $sender_address was not, when it was used in a string?








best regards,
Marius