-/* $Cambridge: exim/src/src/lookups/dnsdb.c,v 1.6 2004/12/20 15:24:28 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/dnsdb.c,v 1.9 2005/01/11 15:51:03 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 2004 */
+/* Copyright (c) University of Cambridge 1995 - 2005 */
/* See the file NOTICE for conditions of use and distribution. */
#include "../exim.h"
int searchtype = (type == T_ZNS)? T_NS : /* record type we want */
(type == T_MXH)? T_MX : type;
- /* If the type is PTR, we have to construct the relevant magic lookup
- key. This code is now in a separate function. */
+ /* If the type is PTR, we have to construct the relevant magic lookup key if
+ the original is an IP address (some experimental protocols are using PTR
+ records for different purposes where the key string is a host name). This
+ code for doing the reversal is now in a separate function. */
- if (type == T_PTR)
+ if (type == T_PTR && string_is_ip_address(domain, NULL) > 0)
{
dns_build_reverse(domain, rbuffer);
domain = rbuffer;