Szerző: Aki Kyo Dátum: Címzett: exim-users Tárgy: Re: [exim] How to trap "command timed out"? (avoid 451 reject)
On 3/14/19, Jeremy Harris via Exim-users <exim-users@???> wrote: > On 14/03/2019 18:28, Aki Kyo via Exim-users wrote:
>> ${run{/path/to/command $mime_decoded_filename}}
>>
>> In some very rare cases, I get "command timed out" and the message is
>> rejected with 451 code
>>
>> Aside from debugging why it timed out, most important, how can I catch
>> this condition so the timed out command doesn't cause a 4xx temporary
>> rejection?
> You didn't say how you're using the expansion result,
> so we don't actually know why an expansion fail becomes
> a message tmp-reject.
Isn't the error saying that the command timed out? Why is the
assignment of its output relevant?
If it matters, the output is being put into a variable:
set acl_c_mime_flag = MIME flag ${run{/usr/bin/timeout 30
/path/to/command $mime_decoded_filename}}
Using timeout as suggested by Ian and Evgeniy sees to have fixed
problem but if you have more to say, like very much to learn why you
said that. Because still a bit confused why it failed anyway, the
executed script is very simple and should not take a minute to run.
> If you have to, code the values for the return options explicitly:
>
> ${run{/path/to/command $mime_decoded_filename} {$value} {OOPS}}
>
> and do something appropriate with the fail value.
How does that help? My tests show the timeout caused immediate reject
and wont get far enough to do anything with the fail value.