Phil Pennock wrote:
>>> Is it possible to retrieve the highest prioritized MX record using a
>>> dnsdb lookup? If so, how?
>> The results returned by dnsdb when doing an mx or mxh lookup are not
>> ordered by priority:
>>
>> r...@haven:~# exim4 -be '${lookup dnsdb{mx=googlemail.com}}'
>> 30 alt3.gmail-smtp-in.l.google.com
>> 40 alt4.gmail-smtp-in.l.google.com
>> 5 gmail-smtp-in.l.google.com
>> 10 alt1.gmail-smtp-in.l.google.com
>> 20 alt2.gmail-smtp-in.l.google.com
>> r...@haven:~#
>>
>> I'm not sure how you could pick out the item with the lowest priority
>> using Exim expansions.
>
> ${reduce{<\n ${lookup dnsdb{mx=googlemail.com}}}{65535 .}{${if
> <{${extract{1}{ }{$item}}}{${extract{1}{ }{$value}}}{$item}{$value}}}}
Superb.
--
Mike Cardwell
(https://secure.grepular.com/) (http://perlcv.com/)
--
## List details at http://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/