Author: Kevin P. Fleming Date: To: Exim users list Subject: Re: [Exim] callout with three-way switch depending on the results?
Alan J. Flavell wrote:
> So I'm interested to know if there's some way that I can distinguish
> between an active response from the callout host, and the callout
> having been declared a success because of a timeout in conjunction
> with the defer_ok option. I've pored over the expansion variables to
> see whether there's anything set which I can test, but I don't find
> anything.
As it stands today, no, I don't see a way you can do this. The ACL conditions
don't have any way to support three-valued logic, and there aren't enough
callout sub-options to tell it what to do in each of these cases.
In addition, even if there were additional callout sub-options, you'd have to
have the callout repeated in multiple ACLs to handle the different possible
results, and if the first callout times out, this will not be remembered and
each additional callout will still be attempted. This is bad, because it's a
waste of time and resources, and additionally if first callout times out the
second one might not, so then your logic falls apart.
So, the only way I can see this working is if the callout actually returned
different results for all three cases _AND_ if the callout actually was an
expansion item, not a condition. If it was an expansion item, you could store
the result into an ACL variable and then make tests against that stored value.
I'd bet it wouldn't be terribly difficult to create an expansion item to do
callouts, but the devil is in the details... At a minimum, the item could only
be used during the same ACLs that callouts are already involved in.