Re: [EXIM] DNS

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Christopher Purnell
CC: exim-users
Assumpte: Re: [EXIM] DNS
On Thu, 9 Apr 1998, Christopher Purnell wrote:

> Exim seems to have a problem with self referring mx records where
> there is no corresponding a record. Exim just gets stuck in an
> infinite loop doing the same dns lookups and allocating memory as it
> goes.


This turns out to be a bug in the domainlist router, which was being
used in this case. (There is no problem with the lookuphost router.) If
domainlist contained an entry of the form

<pattern> host.name bydns

and looking up host.name's MX records produced more than one host, and
some of those hosts had no A record, then those hosts were re-looked up
by domainlist, as if they were in the original list of hosts. If any of
them had the same name as host.name, a loop ensued. The bug is very old
and has been in Exim for many releases. The patch below fixes it.

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714



*** exim-1.90/src/routers/domainlist.c        Fri Mar 27 12:42:15 1998
--- routers/domainlist.c    Wed Apr 15 11:21:57 1998
***************
*** 251,257 ****
  BOOL free_routelist_item = FALSE;
  BOOL individual_transport_set = FALSE;
  int lookup_type, rc;
! host_item *h, *prev, **hchain;
  char *routelist_item = NULL;
  char *domain, *hostlist, *newhostlist, *options, *name, *listptr;
  domainlist_router_options_block *ob =
--- 251,257 ----
  BOOL free_routelist_item = FALSE;
  BOOL individual_transport_set = FALSE;
  int lookup_type, rc;
! host_item *h, *next_h, *prev, **hchain;
  char *routelist_item = NULL;
  char *domain, *hostlist, *newhostlist, *options, *name, *listptr;
  domainlist_router_options_block *ob =
***************
*** 648,664 ****



/* Look up each host address. A lookup may add additional items into the chain
! if there are multiple addresses. If any host is identified as being the local
host, omit it and any subsequent hosts - i.e. treat the list like an ordered
list of MX hosts. If the first host is the local host, act according to the
"self" option in the configuration. */

  prev = NULL;
! for (h = addr->host_list; h != NULL; prev = h, h = h->next)
    {
    char *canonical_name;
    int rc;


    if (h->address != NULL) continue;


    if (lookup_type == lk_byname)
--- 648,666 ----



/* Look up each host address. A lookup may add additional items into the chain
! if there are multiple addresses. Hence the use of next_h to start each cycle of
! the loop at the next original host. If any host is identified as being the local
host, omit it and any subsequent hosts - i.e. treat the list like an ordered
list of MX hosts. If the first host is the local host, act according to the
"self" option in the configuration. */

  prev = NULL;
! for (h = addr->host_list; h != NULL; prev = h, h = next_h)
    {
    char *canonical_name;
    int rc;


+   next_h = h->next;
    if (h->address != NULL) continue;


    if (lookup_type == lk_byname)




--
*** Exim information can be found at http://www.exim.org/ ***