* Backed out r7276 through r7278. This is too large a change to make during a featur...
[citadel.git] / citadel / tuiconfig.c
index ed1fdfb202c7004cff6b5d5681ebbba621a77f31..5197abeae8e662f819a03fd42cf5df7b54cc541a 100644 (file)
@@ -29,6 +29,7 @@
 #include <pwd.h>
 #include <errno.h>
 #include <stdarg.h>
+#include <libcitadel.h>
 #include "sysdep.h"
 #include "citadel.h"
 #include "citadel_ipc.h"
@@ -37,7 +38,6 @@
 #include "messages.h"
 #include "routines.h"
 #include "commands.h"
-#include "tools.h"
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
 #endif
@@ -63,7 +63,7 @@ extern int screenwidth;
 void do_system_configuration(CtdlIPC *ipc)
 {
 
-#define NUM_CONFIGS 61
+#define NUM_CONFIGS 67
 
        char buf[256];
        char sc[NUM_CONFIGS][256];
@@ -171,6 +171,11 @@ void do_system_configuration(CtdlIPC *ipc)
        strprompt("SMTPS server port (-1 to disable)", &sc[41][0], 5);
        strprompt("Postfix TCP Dictionary Port server port (-1 to disable)", &sc[50][0], 5);
        strprompt("ManageSieve server port (-1 to disable)", &sc[51][0], 5);
+
+       strprompt("XMPP (Jabber) client to server port (-1 to disable)", &sc[62][0], 5);
+       /* No prompt because we don't implement this service yet, it's just a placeholder */
+       /* strprompt("XMPP (Jabber) server to server port (-1 to disable)", &sc[63][0], 5); */
+
        /* This logic flips the question around, because it's one of those
         * situations where 0=yes and 1=no
         */
@@ -180,6 +185,20 @@ void do_system_configuration(CtdlIPC *ipc)
                a);
        a = (a ? 0 : 1);
        snprintf(sc[25], sizeof sc[25], "%d", a);
+
+       snprintf(sc[66], sizeof sc[66], "%d", (boolprompt(
+               "Flag messages as spam instead of rejecting",
+               atoi(&sc[66][0]))));
+
+       /* This logic flips the question around, because it's one of those
+        * situations where 0=yes and 1=no
+        */
+       a = atoi(sc[61]);
+       a = (a ? 0 : 1);
+       a = boolprompt("Force IMAP posts in public rooms to be from the user who submitted them", a);
+       a = (a ? 0 : 1);
+       snprintf(sc[61], sizeof sc[61], "%d", a);
+
        snprintf(sc[45], sizeof sc[45], "%d", (boolprompt(
                "Allow unauthenticated SMTP clients to spoof my domains",
                atoi(&sc[45][0]))));
@@ -267,6 +286,8 @@ void do_system_configuration(CtdlIPC *ipc)
        }
 
        strprompt("How often to run network jobs (in seconds)", &sc[28][0], 5);
+       strprompt("Default frequency to run POP3 collection (in seconds)", &sc[64][0], 5);
+       strprompt("Fastest frequency to run POP3 collection (in seconds)", &sc[65][0], 5);
        strprompt("Hour to run purges (0-23)", &sc[31][0], 2);
        snprintf(sc[42], sizeof sc[42], "%d", (boolprompt(
                "Enable full text search index (warning: resource intensive)",
@@ -368,27 +389,27 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) {
        int sel;
 
        keyopt(" <1> localhost      (Alias for this computer)\n");
-       keyopt(" <2> gateway domain (Domain for all Citadel systems)\n");
-       keyopt(" <3> smart-host     (Forward all outbound mail to this host)\n");
-       keyopt(" <4> directory      (Consult the Global Address Book)\n");
-       keyopt(" <5> SpamAssassin   (Address of SpamAssassin server)\n");
-       keyopt(" <6> RBL            (domain suffix of spam hunting RBL)\n");
-       keyopt(" <7> masq domains   (Domains as which users are allowed to masquerade)\n");
-       sel = intprompt("Which one", 1, 1, 6);
+       keyopt(" <2> smart-host     (Forward all outbound mail to this host)\n");
+       keyopt(" <3> directory      (Consult the Global Address Book)\n");
+       keyopt(" <4> SpamAssassin   (Address of SpamAssassin server)\n");
+       keyopt(" <5> RBL            (domain suffix of spam hunting RBL)\n");
+       keyopt(" <6> masq domains   (Domains as which users are allowed to masquerade)\n");
+       keyopt(" <7> ClamAV         (Address of ClamAV clamd server)\n");
+       sel = intprompt("Which one", 1, 1, 7);
        switch(sel) {
                case 1: strcpy(buf, "localhost");
                        return;
-               case 2: strcpy(buf, "gatewaydomain");
+               case 2: strcpy(buf, "smarthost");
                        return;
-               case 3: strcpy(buf, "smarthost");
+               case 3: strcpy(buf, "directory");
                        return;
-               case 4: strcpy(buf, "directory");
+               case 4: strcpy(buf, "spamassassin");
                        return;
-               case 5: strcpy(buf, "spamassassin");
+               case 5: strcpy(buf, "rbl");
                        return;
-               case 6: strcpy(buf, "rbl");
+               case 6: strcpy(buf, "masqdomain");
                        return;
-               case 7: strcpy(buf, "masqdomain");
+               case 7: strcpy(buf, "clamav");
                        return;
        }
 }
@@ -954,12 +975,14 @@ void do_pop3client_configuration(CtdlIPC *ipc)
                        "      Remote POP3 host       "
                        "         User name           "
                        "Keep on server? "
+                       "Fetching inteval"
                        "\n");
                color(DIM_WHITE);
                scr_printf(     "--- "
                        "---------------------------- "
                        "---------------------------- "
                        "--------------- "
+                       "---------------- "
                        "\n");
                for (i=0; i<num_recs; ++i) {
                color(DIM_WHITE);
@@ -974,7 +997,9 @@ void do_pop3client_configuration(CtdlIPC *ipc)
                scr_printf("%-28s ", buf);
 
                color(BRIGHT_CYAN);
-               scr_printf("%-15s\n", (extract_int(recs[i], 4) ? "Yes" : "No") );
+               scr_printf("%-15s ", (extract_int(recs[i], 4) ? "Yes" : "No") );
+               color(BRIGHT_MAGENTA);
+               scr_printf("%ld\n", extract_long(recs[i], 5) );
                color(DIM_WHITE);
                }
 
@@ -998,6 +1023,8 @@ void do_pop3client_configuration(CtdlIPC *ipc)
                                scr_printf("Keep messages on server instead of deleting them? ");
                                sprintf(&buf[strlen(buf)], "%d", yesno());
                                strcat(buf, "|");
+                               newprompt("Enter interval : ", &buf[strlen(buf)], 5);
+                               strcat(buf, "|");
                                recs[num_recs-1] = strdup(buf);
                                modified = 1;
                                break;