From: Art Cancro Date: Sat, 18 Jan 2003 06:03:06 +0000 (+0000) Subject: * More work on fake resolver X-Git-Tag: v7.86~6028 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=aa32aa87b4261ab7faacc64fbd024685fe435693;p=citadel.git * More work on fake resolver --- diff --git a/citadel/acconfig.h b/citadel/acconfig.h index f69e12317..63e475208 100644 --- a/citadel/acconfig.h +++ b/citadel/acconfig.h @@ -33,3 +33,6 @@ /* define this if you have the libical calendaring library available */ #undef HAVE_LIBICAL + +/* define this if you have the resolv.h header file. */ +#undef HAVE_RESOLV_H diff --git a/citadel/configure.ac b/citadel/configure.ac index ff0248f4e..be9985a6b 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -434,7 +434,7 @@ if test "x$with_ncurses" != xno; then AC_CHECK_HEADERS(ncurses.h,,,[ ]) fi -AC_CHECK_HEADER(resolv.h,,, +AC_CHECK_HEADER(resolv.h,AC_DEFINE(HAVE_RESOLV_H),, [#ifdef HAVE_SYS_TYPES_H #include #endif @@ -445,8 +445,6 @@ AC_CHECK_HEADER(resolv.h,,, #include #endif]) -AC_SUBST(SMTP) -AC_SUBST(DOMAIN) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/citadel/domain.c b/citadel/domain.c index f16f0814f..6dcbcafc3 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -10,8 +10,12 @@ #include #include #include + +#ifdef HAVE_RESOLV_H #include #include +#endif + #include "sysdep_decls.h" #include "citadel.h" #include "domain.h" @@ -110,10 +114,14 @@ void sort_mxrecs(struct mx *mxrecs, int num_mxrecs) { * */ int getmx(char *mxbuf, char *dest) { + +#ifdef HAVE_RESOLV_H union { u_char bytes[1024]; HEADER header; } answer; +#endif + int ret; unsigned char *startptr, *endptr, *ptr; char expanded_buf[1024]; @@ -137,7 +145,7 @@ int getmx(char *mxbuf, char *dest) { * No smart-host? Look up the best MX for a site. */ -#ifdef __CYGWIN__ +#ifndef HAVE_RESOLV_H /* * On systems with b0rken or non-standard resolver libraries, learn @@ -153,7 +161,7 @@ int getmx(char *mxbuf, char *dest) { pclose(fp); return(0); /* FIXME */ -#else /* __CYGWIN__ */ +#else /* HAVE_RESOLV_H */ /* * Make a call to the standard resolver library. @@ -230,7 +238,7 @@ int getmx(char *mxbuf, char *dest) { } } } -#endif /* __CYGWIN__ */ +#endif /* HAVE_RESOLV_H */ sort_mxrecs(mxrecs, num_mxrecs);