* Client config for internet
authorArt Cancro <ajc@citadel.org>
Fri, 28 Jan 2000 03:51:52 +0000 (03:51 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 28 Jan 2000 03:51:52 +0000 (03:51 +0000)
citadel/citadel.c
citadel/citadel.h
citadel/citadel.rc
citadel/domain.c
citadel/routines2.c
citadel/routines2.h

index bd384a41876bd4cbaaebf877895d2d29899695bf..c68173a68603cb252356886ae248b4e53eeccc87 100644 (file)
@@ -1249,6 +1249,10 @@ GSTA:    termn8 = 0;
                                do_system_configuration();
                                break;
 
+                       case 82:
+                               do_internet_configuration();
+                               break;
+
                        case 50:
                                enter_config(2);
                                break;
index 763beeee22d79d1404ae1afd63cd0515560ad5a9..b97a759799f762be759ca60a0f4e89cdd1c31180 100644 (file)
@@ -238,8 +238,11 @@ struct floor {
 #define GF_SKIP                1               /* <;S>kip floor mode */
 #define GF_ZAP         2               /* <;Z>ap floor mode */
 
-
+/*
+ * MIME types used in Citadel for configuration stuff
+ */
 #define SPOOLMIME      "application/x-citadel-delivery-list"
+#define        INTERNETCFG     "application/x-citadel-internet-config"
 
 /*
  * This structure is used to hold all of the fields of a message
index c209c19142b90c75accee54c6d5dd06fe097c591..b195cac0dbdf7be0e980f503aa664125eeb63bd8 100644 (file)
@@ -171,7 +171,8 @@ cmd=53,1,&.,&Aide,&File,&Send over net
 cmd=54,1,&.,&Aide,&File,&Move
 cmd=70,2,&.,&Aide,&Message edit:
 cmd=78,1,&.,&Aide,&Post
-cmd=80,2,&.,&Aide,&System configuration
+cmd=80,2,&.,&Aide,&System configuration,&General
+cmd=82,2,&.,&Aide,&System configuration,&Internet
 
 cmd=29,0,&.,&Terminate,and &Quit
 cmd=30,0,&.,&Terminate,and &Stay online
index df44d21ddc0010026d0c862867d6a7e5ab077a3b..d68a9a38c5c73bf074ba3f75ebe815a5abeabdbb 100644 (file)
@@ -23,6 +23,7 @@ int getmx(char *mxbuf, char *dest) {
        int ret;
 
 
+
        /* If we're configured to send all mail to a smart-host, then our
         * job here is really easy.
         */
@@ -38,5 +39,16 @@ int getmx(char *mxbuf, char *dest) {
                C_IN, T_MX, answer, sizeof(answer)  );
 
        lprintf(9, "res_query() returned %d\n", ret);
-       return(0); /* FIX not yet working!! */
+
+       if (ret < 0) {
+               lprintf(5, "No MX found\n");
+               return(0);
+       }
+
+       /* If we had to truncate, shrink the number to avoid fireworks */
+       if (ret > sizeof(answer))
+               ret = sizeof(answer);
+
+       /* FIX not done yet */
+       return(0);
 }
index 644f1d044f319e679a79729451a383577e3af243..297e2f767efc6069a8c0b95edd79c35947614a5a 100644 (file)
@@ -744,3 +744,51 @@ void do_system_configuration(void)
                serv_gets(buf);
        }
 }
+
+
+/*
+ * Internet mail configuration
+ */
+void do_internet_configuration(void) {
+       char buf[256];
+       int num_recs = 0;
+       char ch;
+       int badkey;
+       int i;
+       
+
+       sprintf(buf, "CONF getsys|%s", INTERNETCFG);
+       serv_puts(buf);
+       serv_gets(buf);
+       if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
+       }
+
+       while (1) {
+               /* do display */
+
+               keyopt("\n<A>dd <D>elete <S>ave <Q>uit -> ");
+               badkey = 0;
+               do {
+                       ch = inkey();
+                       ch = tolower(ch);
+                       switch(ch) {
+                               case 'a':
+                                       printf("Add\n");
+                                       break;
+                               case 'd':
+                                       printf("Delete\n");
+                                       break;
+                               case 's':
+                                       printf("Save\n");
+                                       return;
+                               case 'q':
+                                       printf("Quit\n");
+                                       i = boolprompt("Quit without saving", 0);
+                                       if (i == 1) return;
+                                       break;
+                               default:
+                                       badkey = 1;
+                       }
+               } while (badkey == 1);
+       }
+}
index 087465bedfbf0c4ce3dd5bc04970332e600ba90b..6f1ced38caccaab0250ab6ff38e06f9a557bdce7 100644 (file)
@@ -12,3 +12,4 @@ void validate(void);
 void read_bio(void);
 void cli_image_upload(char *keyname);
 int room_prompt(int qrflags);
+void do_internet_configuration(void);