diff options
-rw-r--r-- | INSTALL | 5 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | fetchmail.c | 14 | ||||
-rw-r--r-- | mxget.c | 22 |
4 files changed, 29 insertions, 14 deletions
@@ -35,11 +35,6 @@ build it, you may find you need flex at version 2.5.3 or greater. The stock lex distributed with Linux does not work -- it yields a parser which core-dumps on syntax errors. -If mxget.c fails to compile, your DNS-query support isn't compatible -with BSD's and Linux's. Manually undefine HAVE_GETHOSTBYNAME in -config.h and rebuild. You'll lose the multidrop-mailbox feature and -Kerberos option, but nothing else. - 3. INSTALL Lastly, become root and run diff --git a/configure.in b/configure.in index ee435b1d..bbd15acd 100644 --- a/configure.in +++ b/configure.in @@ -61,7 +61,7 @@ dnl All AC_CHECK_FUNCs must precede the following AC_SUBSTs AC_SUBST(EXTRASRC) AC_SUBST(EXTRAOBJ) -AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname) +AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname res_search) dnl AC_FUNC_SETVBUF_REVERSED diff --git a/fetchmail.c b/fetchmail.c index d0f04bb4..f591d3fb 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -302,9 +302,9 @@ char **argv; * reflect the status of that transaction. */ do { -#ifdef HAVE_GETHOSTBYNAME +#ifdef HAVE_RES_SEARCH sethostent(TRUE); /* use TCP/IP for mailserver queries */ -#endif /* HAVE_GETHOSTBYNAME */ +#endif /* HAVE_RES_SEARCH */ for (ctl = querylist; ctl; ctl = ctl->next) { @@ -316,9 +316,9 @@ char **argv; } } -#ifdef HAVE_GETHOSTBYNAME +#ifdef HAVE_RES_SEARCH endhostent(); /* release TCP/IP connection to nameserver */ -#endif /* HAVE_GETHOSTBYNAME */ +#endif /* HAVE_RES_SEARCH */ /* * Close all SMTP delivery sockets. For optimum performance @@ -490,7 +490,9 @@ int optind; else ctl->canonical_name = xstrdup((char *)namerec->h_name); } -#else +#endif /* HAVE_GETHOSTBYNAME */ + +#if !defined(HAVE_GETHOSTBYNAME) || !defined(HAVE_RES_SEARCH) /* can't handle multidrop mailboxes unless we can do DNS lookups */ if (ctl->localnames && ctl->localnames->next) { @@ -498,7 +500,7 @@ int optind; stderr); exit(PS_SYNTAX); } -#endif /* HAVE_GETHOSTBYNAME */ +#endif /* !HAVE_GETHOSTBYNAME || !HAVE_RES_SEARCH */ /* * Assign SMTP leaders. We want to allow all query blocks @@ -7,7 +7,7 @@ */ #include "config.h" -#ifdef HAVE_GETHOSTBYNAME +#ifdef HAVE_RES_SEARCH #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> @@ -19,6 +19,24 @@ * This ought to be in the bind library. It's adapted from sendmail. */ +/* + * These are defined in RFC833. Some bind interface headers don't declare them. + * Ghod help us if they're ever actually incompatible with what's in + * the arpa/nameser.h header. + */ +#ifndef PACKETSZ +#define PACKETSZ 512 /* maximum packet size */ +#endif +#ifndef HFIXEDSZ +#define HFIXEDSZ 12 /* #/bytes of fixed data in header */ +#endif +#ifndef INT32SZ +#define INT32SZ 4 /* for systems without 32-bit ints */ +#endif +#ifndef INT16SZ +#define INT16SZ 2 /* for systems without 16-bit ints */ +#endif + /* minimum possible size of MX record in packet */ #define MIN_MX_SIZE 8 /* corresp to "a.com 0" w/ terminating space */ @@ -80,7 +98,7 @@ const char *name; pmx[ind].pref = -1; return(pmx); } -#endif /* HAVE_GETHOSTBYNAME */ +#endif /* HAVE_RES_SEARCH */ #ifdef TESTMAIN main(int argc, char *argv[]) |