Re: [exim] Get the value of an external script in a conditio…

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Mueller
Data:  
Para: 'Jeremy Harris', exim-users
Assunto: Re: [exim] Get the value of an external script in a condition
So when I run Exim in verbose. It turns out the expansion is working, but
nervertheless it points to false but it should be true?:


13:54:04  9383 processing "defer"
13:54:04  9383 expanding: run{/etc/exim/panama  $sender_address_domain
13:54:04  9383    result: run{/etc/exim/panama  timerunr.com
13:54:04  9383 expanding: NameCheap <-------------------------------------
13:54:04  9383    result: NameCheap
<---------------------------------------
13:54:04  9383 condition: match{run{/etc/exim/panama
$sender_address_domain}{NameCheap}
13:54:04  9383    result: false
13:54:04  9383 expanding: true
13:54:04  9383    result: true
13:54:04  9383 skipping: result is not used
13:54:04  9383 expanding: false
13:54:04  9383    result: false
13:54:04  9383 expanding: ${if match{run{/etc/exim/panama
$sender_address_domain}{NameCheap}{true}{false}}
13:54:04  9383    result: false
13:54:04  9383 check condition = ${if match{run{/etc/exim/panama
$sender_address_domain}{NameCheap}{true}{false}}
13:54:04  9383                 = false
13:54:04  9383 defer: condition test failed


So what is going wrong ?




-----Ursprüngliche Nachricht-----
Von: Jeremy Harris via Exim-users [mailto:exim-users@exim.org]
Gesendet: Dienstag, 20. Februar 2018 10:35
An: exim-users@???
Betreff: Re: [exim] Get the value of an external script in a condition

On 20/02/18 09:15, Mueller via Exim-users wrote:
> #!/bin/bash
> out=$(/usr/bin/whois $1|grep "Registrar:"| cut -d ':' -f2| awk '{print
> $1}') echo "$out"
>
> I tried it with the $run command, but it uis always set to false!
>
> defer condition= ${if match{run{/etc/exim/panama
> $sender_address_domain}{NameCheap}{true}{false}}


The docs say:

"If the command succeeds (gives a zero return code) <string1> is expanded
and replaces the entire item; during this expansion, the standard
output/error from the command is in the variable $value. If the command
fails, <string2>, if present, is expanded and used."
--
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/