diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-28 03:49:39 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-28 03:49:39 +0000 |
commit | b1000cb703b852ea6c7493d9d8d24780e4a3b157 (patch) | |
tree | cd6a56441d638475c0b331cda5b3c0c7c1fbfd5f /fetchmail.c | |
parent | cab2269e10d82e3e5e371889b42d19d0cafc9eaa (diff) | |
download | fetchmail-b1000cb703b852ea6c7493d9d8d24780e4a3b157.tar.gz fetchmail-b1000cb703b852ea6c7493d9d8d24780e4a3b157.tar.bz2 fetchmail-b1000cb703b852ea6c7493d9d8d24780e4a3b157.zip |
Cleanup for PL3.
svn path=/trunk/; revision=402
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/fetchmail.c b/fetchmail.c index aa8dff4e..89b9d713 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -71,7 +71,7 @@ int main (argc,argv) int argc; char **argv; { - int st, bkgd, lossage; + int st, lossage, bkgd = FALSE; struct query def_opts; int parsestatus, implicitmode; char *home, *tmpdir, tmpbuf[BUFSIZ]; @@ -202,17 +202,26 @@ char **argv; ctl->uid = pw->pw_uid; #ifdef HAVE_GETHOSTBYNAME - /* compute the canonical name of the host */ - namerec = gethostbyname(ctl->servername); - if (namerec == (struct hostent *)NULL) + /* + * Don't do DNS lookup unless we need to because we're going + * to use Kerberos or process a multidrop box. Some sites + * won't have DNS up at fetchmail initialization time but aren't + * using these features -- avoid hosing them unnecessarily. + */ + if (ctl->authenticate == A_KERBEROS || MULTIDROP(ctl)) { - fprintf(stderr, - "fetchmail: can't get canonical name of host %s\n", - ctl->servername); - exit(PS_SYNTAX); + /* compute the canonical name of the host */ + namerec = gethostbyname(ctl->servername); + if (namerec == (struct hostent *)NULL) + { + fprintf(stderr, + "fetchmail: can't get canonical name of host %s\n", + ctl->servername); + exit(PS_SYNTAX); + } + else + ctl->canonical_name = xstrdup((char *)namerec->h_name); } - else - ctl->canonical_name = xstrdup((char *)namerec->h_name); #else /* can't handle multidrop mailboxes unless we can do DNS lookups */ if (ctl->localnames && ctl->localnames->next) |