X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fsrc%2Frouters%2Frf_lookup_hostlist.c;h=68ff8c5b097a07a06459002120936273bbaf5c87;hb=ed2a48660e22ce41fc7ca692743531ffdca57868;hp=9876225478d879217b13988c888ef68e331d1a56;hpb=322050c2d9e83d10f046da71aa2cd9cc5a355b0b;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/routers/rf_lookup_hostlist.c b/src/src/routers/rf_lookup_hostlist.c index 987622547..68ff8c5b0 100644 --- a/src/src/routers/rf_lookup_hostlist.c +++ b/src/src/routers/rf_lookup_hostlist.c @@ -1,10 +1,10 @@ -/* $Cambridge: exim/src/src/routers/rf_lookup_hostlist.c,v 1.7 2006/10/09 14:36:25 ph10 Exp $ */ +/* $Cambridge: exim/src/src/routers/rf_lookup_hostlist.c,v 1.10 2007/03/14 11:22:23 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2006 */ +/* Copyright (c) University of Cambridge 1995 - 2007 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -64,13 +64,13 @@ 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) +for (h = addr->host_list; h != NULL; h = next_h) { uschar *canonical_name; int rc, len, port; next_h = h->next; - if (h->address != NULL) continue; + if (h->address != NULL) { prev = h; continue; } DEBUG(D_route|D_host_lookup) debug_printf("finding IP address for %s\n", h->name); @@ -157,6 +157,12 @@ for (h = addr->host_list; h != NULL; prev = h, h = next_h) if (rc == HOST_FIND_FAILED) { + if (hff_code == hff_ignore) + { + if (prev == NULL) addr->host_list = next_h; else prev->next = next_h; + continue; /* With the next host, leave prev unchanged */ + } + if (hff_code == hff_pass) return PASS; if (hff_code == hff_decline) return DECLINE; @@ -206,6 +212,12 @@ for (h = addr->host_list; h != NULL; prev = h, h = next_h) } self_send = TRUE; } + + /* Ensure that prev is the host before next_h; this will not be h if a lookup + found multiple addresses or multiple MX records. */ + + prev = h; + while (prev->next != next_h) prev = prev->next; } return OK;