fetchmail-friends
[Top] [All Lists]

[fetchmail]adjusting for fetchmail doing unnecessary name lookups

2001-06-06 11:20:58
This patch fixes a headache I've been running into as my multidrop
.fetchmailrc grows bigger.  It fixes it with 5.7.6 and 5.8.5.

e.g., you plug your laptop in at the office-of-the-day for whoever you happen
to be contracting with.  You run fetchmail which goes and looks up `foobar' as
part of its process, since you have an entry `skip foobar ...' in your
.fetchmailrc.  That host is actually only a name that can be resolved when
you're on your home network, so fetchmail pauses then finally bails
complaining that DNS didn't work with it.

This change makes it honor `no dns' entries for that process as well, and in
particular helps me out by letting me use `skip' instead of `poll' for
problematic entries, which I'd then explicitly invoke when it's appropriate.
(`fetchmail foobar' at home, `fetchmail' by itself hitting the one entry
marked `poll' that I have that I know will work anywhere.)

One approach: create a skip entry for a `foobar' host, and selectively define
or omit it from your /etc/hosts file or your nameserver, and you should be
able to reproduce the problem.

It occurs to me that one alternative would be to take this piece:

    if ((implicitmode = (optind >= argc)))
    {
        for (ctl = querylist; ctl; ctl = ctl->next)
            ctl->active = TRUE;
    }
    else ...

and make it not happen if ctl->server.skip, perhaps.

All the best,
B

2001-06-06  Brendan Kehoe  <brendan(_at_)zen(_dot_)org>

        * fetchmail.c (load_params): Do not do any name lookups if
        !ctl->server.dns.  Those set with `poll' will be handled
        appropriately, and more importantly those with `skip' will thus not be
        attempted.

--- ./fetchmail.c.~1~   Tue May 29 22:46:11 2001
+++ ./fetchmail.c       Wed Jun  6 18:06:37 2001
@@ -1111,7 +1111,7 @@ static int load_params(int argc, char **
                ctl->server.truename = xstrdup(leadname);
            }
 #ifdef HAVE_GETHOSTBYNAME
-           else if (ctl->active && !configdump)
+           else if (ctl->active && ctl->server.dns && !configdump)
            {
                if (ctl->server.authenticate==A_KERBEROS_V4 ||
                      ctl->server.authenticate==A_KERBEROS_V5 ||




-- 
Brendan Kehoe                                               
brendan(_at_)zen(_dot_)org

http://www.zen.org/~brendan/


<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail]adjusting for fetchmail doing unnecessary name lookups, Brendan Kehoe <=