From: Art Cancro Date: Fri, 17 Jan 2003 22:36:56 +0000 (+0000) Subject: * This commit is a figment of your imagination. X-Git-Tag: v7.86~6029 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=048f19e4d58289f3616abd5946096098776969e5 * This commit is a figment of your imagination. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 20cd97ab8..355e5a9e1 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 601.118 2003/01/17 22:36:56 ajc + * This commit is a figment of your imagination. + Revision 601.117 2003/01/17 21:50:27 ajc * Began making some build changes for Cygwin compatibility @@ -4416,4 +4419,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 564f57c44..005091284 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -21,13 +21,12 @@ all: $(TARGETS) EXEEXT=@EXEEXT@ -SMTP=@SMTP@ - CLIENT_TARGETS=citadel$(EXEEXT) whobbs$(EXEEXT) SERVER_TARGETS=citserver setup $(CHKPWD) SERV_MODULES=serv_chat.o \ serv_upgrade.o \ - $(SMTP) \ + serv_smtp.o \ + serv_spam.o \ serv_pop3.o \ serv_vcard.o vcard.o \ serv_mrtg.o \ @@ -74,12 +73,10 @@ DATABASE=@DATABASE@ VPATH=$(srcdir) -DOMAIN=@DOMAIN@ - SOURCES=aidepost.c auth.c base64.c chkpwd.c citadel.c citadel_ipc.c \ citmail.c citserver.c client_chat.c client_passwords.c \ clientsocket.c commands.c config.c control.c $(DATABASE) \ - $(DOMAIN) serv_extensions.c file_ops.c genstamp.c getutline.c \ + domain.c serv_extensions.c file_ops.c genstamp.c getutline.c \ housekeeping.c html.c imap_fetch.c imap_misc.c imap_search.c \ imap_store.c imap_tools.c internet_addressing.c ipc_c_tcp.c \ locate_host.c logging.c md5.c messages.c migratenet.c \ @@ -121,7 +118,7 @@ parsedate.o: parsedate.c SERV_OBJS = server_main.o \ user_ops.o citserver.o sysdep.o serv_extensions.o \ - tools.o $(DATABASE:.c=.o) $(DOMAIN:.c=.o) \ + tools.o $(DATABASE:.c=.o) domain.o \ control.o policy.o config.o support.o room_ops.o \ file_ops.o msgbase.o \ locate_host.o housekeeping.o logging.o mime_parser.o html.o \ diff --git a/citadel/configure.ac b/citadel/configure.ac index 2594773e8..ff0248f4e 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, [SMTP=serv_smtp.o serv_spam.o; DOMAIN=domain.c],, +AC_CHECK_HEADER(resolv.h,,, [#ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/citadel/domain.c b/citadel/domain.c index 0d276626c..f16f0814f 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -117,6 +117,8 @@ int getmx(char *mxbuf, char *dest) { int ret; unsigned char *startptr, *endptr, *ptr; char expanded_buf[1024]; + char buf[SIZ]; + FILE *fp; unsigned short pref, type; int n = 0; int qdcount; @@ -130,9 +132,33 @@ int getmx(char *mxbuf, char *dest) { n = get_hosts(mxbuf, "smarthost"); if (n > 0) return(n); + /* * No smart-host? Look up the best MX for a site. */ + +#ifdef __CYGWIN__ + + /* + * On systems with b0rken or non-standard resolver libraries, learn + * the MX records by calling "nslookup" from the command line. + */ + sprintf(buf, "nslookup -query=mx %s", dest); + fp = popen(buf, "r"); + if (fp == NULL) return(0); + while (fgets(buf, sizeof buf, fp) != NULL) { + buf[strlen(buf) - 1] = 0; + lprintf(9, "RESOLV: %s\n", buf); + } + pclose(fp); + return(0); /* FIXME */ + +#else /* __CYGWIN__ */ + + /* + * Make a call to the standard resolver library. + */ + ret = res_query( dest, C_IN, T_MX, (unsigned char *)answer.bytes, sizeof(answer) ); @@ -204,6 +230,7 @@ int getmx(char *mxbuf, char *dest) { } } } +#endif /* __CYGWIN__ */ sort_mxrecs(mxrecs, num_mxrecs);