RE: [exim] Help with ${run command}

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Rick Cooper
Data:  
Para: Marc Perkel, exim
CC: 
Assunto: RE: [exim] Help with ${run command}


> -----Original Message-----
> From: exim-users-bounces@??? [mailto:exim-users-bounces@exim.org]On
> Behalf Of Marc Perkel
> Sent: Friday, January 14, 2005 8:26 PM
> To: exim
> Subject: [exim] Help with ${run command}
>
>
> Trying strange tricks again.
>
>    headers add "X-Spamprobe: ${run {/usr/bin/spamprobe score
> /trashme/$message_id.test}{$value}{$value}}"

>
> When I run the above I get the header with no information in it. What am
> I doing wrong? Trying to get the result srting from the command.
>
>


Depends on what the value of $runrc is. If it's anything except 0 then the
output is not returned and $value is not set. If spamprobe fails and you
get -127/255/etc there won't be any output returned and $value is not set.

You could wrap it in a perl script and see what is returned by using
something like

#!/usr/bin/perl
print `/usr/bin/spamprobe $ARGV[1] $ARGV[2]`;
exit 0;

Then call your perl wrapper from exim, and you don't need the extra
{$value}. You could also use a log_write to write the value of $runrc and
see what the return code is. It seems to me that $runrc not being 0 should
not prevent the return of the program's output as many programs use non zero
return codes to mean something other than a plain error.


Rick



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.