From 9471b034a78d53e4bfb951649e9f556cf4e6018c Mon Sep 17 00:00:00 2001 From: Todd Lyons Date: Thu, 19 Jul 2012 08:59:08 -0700 Subject: [PATCH] Add example ACL usage of ${run in exim spec. --- doc/doc-docbook/spec.xfpt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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: -- 2.30.2