* This commit is a figment of your imagination.
authorArt Cancro <ajc@citadel.org>
Fri, 17 Jan 2003 22:36:56 +0000 (22:36 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 17 Jan 2003 22:36:56 +0000 (22:36 +0000)
citadel/ChangeLog
citadel/Makefile.in
citadel/configure.ac
citadel/domain.c

index 20cd97ab88ed201ba564431115d5720284c8698d..355e5a9e121729decbbb4e8c93600f8651833c7a 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 564f57c446ec8af2652674dce86fbb68508815de..005091284c3dd522845a97f2a25d2a94ec4f3eda 100644 (file)
@@ -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 \
index 2594773e8e3694b41ee47a2a543120d912f088c6..ff0248f4ebf5949070949e4282d3a34a72189666 100644 (file)
@@ -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 <sys/types.h>
 #endif
index 0d276626c1f8116cbab5e15b841705a2d54f236d..f16f0814f97d3aa017a99b8c1095b28f02e9fb5f 100644 (file)
@@ -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);