From: Todd Lyons Date: Thu, 19 Jul 2012 15:59:08 +0000 (-0700) Subject: Add example ACL usage of ${run in exim spec. X-Git-Tag: exim-4_81_RC1~40 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/9471b034a78d53e4bfb951649e9f556cf4e6018c Add example ACL usage of ${run in exim spec. --- diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index c8ed79102..19fb321ea 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -9405,6 +9405,20 @@ can be the word &"fail"& (not in braces) to force expansion failure if the command does not succeed. If both strings are omitted, the result is contents of the standard output/error on success, and nothing on failure. +.vindex "&$run_in_acl$&" +The standard output/error of the command is put in the variable &$value$&. +In this ACL example, the output of a command is logged for the admin to +troubleshoot: +.code +warn condition = ${run{/usr/bin/id}{yes}{no}} + log_message = Output of id: $value +.endd +If the command requires shell idioms, such as the > redirect operator, the +shell must be invoked directly, such as with: +.code +${run{/bin/bash -c "/usr/bin/id >/tmp/id"}{yes}{yes}} +.endd + .vindex "&$runrc$&" The return code from the command is put in the variable &$runrc$&, and this remains set afterwards, so in a filter file you can do things like this: