[exim-dev] Exim doesn't look in /etc/hosts when /etc/resolv.…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Jörg Sommer
Datum:  
To: exim-dev
Betreff: [exim-dev] Exim doesn't look in /etc/hosts when /etc/resolv.conf empty
Hi,

I've a smarthost in my local network named server.localnet. It's name is
resolvable via /etc/hosts; ping works. But there's no DNS server
available, hence /etc/resolv.conf is empty. With this setting exim
doesn't feed mails to the smarthost. See
http://alioth.debian.org/~jo-guest/exim-failure-debug.out

But when I set a DNS server that surely doesn't know about
server.localnet, exim looks at /etc/hosts, resolves the name and delivers
the mail.

I found also that setting the option byname for this hostname makes
exim looks up the hostname in /etc/hosts.
http://alioth.debian.org/~jo-guest/exim-success-debug.out

I think you should treat HOST_FIND_AGAIN the same way as
HOST_FIND_FAILED in rf_lookup_hostlist()

  else
    {
    BOOL removed;
    DEBUG(D_route|D_host_lookup) debug_printf("doing DNS lookup\n");
    rc = host_find_bydns(h, ignore_target_hosts, HOST_FIND_BY_A, NULL, NULL,
      NULL, &canonical_name, &removed);
    if (rc == HOST_FOUND)
      {
      if (removed) setflag(addr, af_local_host_removed);
      }
    else if (rc == HOST_FIND_FAILED)    /* || rc == HOST_FIND_AGAIN */
      {
      if (lookup_type == lk_default)
        {
        DEBUG(D_route|D_host_lookup)
          debug_printf("DNS lookup failed: trying getipnodebyname\n");
        rc = host_find_byname(h, ignore_target_hosts, HOST_FIND_QUALIFY_SINGLE,
          &canonical_name, TRUE);
        }
      }
    }


Bye, Jörg.
-- 
Es gibt nichts schöneres als dem Schweigen eines Dummkopfes zuzuhören.
                                              (Helmut Quatlinger)