Ted Cooper wrote:
> Marc Perkel wrote:
>
>> Using dnslists - how can I tell the difference between a failed lookup
>> and a lookup that succeeded but returned no information?
>>
>> Thanks in advance
>>
>
> Conveniently archived for the world to find in "Using DNS lists" on the
> exim website -
> http://docs.exim.org/current/spec_html/ch40.html#SECTmorednslists
>
> <quote>
> If a DNS lookup times out or otherwise fails to give a decisive answer,
> Exim behaves as if the host does not match the list item, that is, as if
> the DNS record does not exist. If there are further items in the DNS
> list, they are processed.
>
> This is usually the required action when dnslists is used with deny
> (which is the most common usage), because it prevents a DNS failure from
> blocking mail. However, you can change this behaviour by putting one of
> the following special items in the list:
> +include_unknown behave as if the item is on the list
> +exclude_unknown behave as if the item is not on the list (default)
> +defer_unknown give a temporary error
> </quote>
>
>
Yeah - I did see that. Here's my situation. I have a list and the test
is to find items that are NOT listed. But - I don't want to get a false
"not listed" should there be a DNS failure. And I'm storing the values
of $dns_result in a variable.
warn condition = ${if def:acl_c_sender_host_domain}
dnslists = hostkarma.junkemailfilter.com/$acl_c_sender_host_domain
set acl_c_karmahost_result = $dnslist_value
So I need the variable to contain a different result if it fails as
opposed to returning an empty result. Although the defer option is
looking more attractive. Maybe a way to return the word "failed" if DNS
fails? is that possible?