From 76bc889cba9ea0bc520c2d722e78f436644f3e3d Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 28 Jan 2000 03:51:52 +0000 Subject: [PATCH] * Client config for internet --- citadel/citadel.c | 4 ++++ citadel/citadel.h | 5 ++++- citadel/citadel.rc | 3 ++- citadel/domain.c | 14 ++++++++++++- citadel/routines2.c | 48 +++++++++++++++++++++++++++++++++++++++++++++ citadel/routines2.h | 1 + 6 files changed, 72 insertions(+), 3 deletions(-) diff --git a/citadel/citadel.c b/citadel/citadel.c index bd384a418..c68173a68 100644 --- a/citadel/citadel.c +++ b/citadel/citadel.c @@ -1249,6 +1249,10 @@ GSTA: termn8 = 0; do_system_configuration(); break; + case 82: + do_internet_configuration(); + break; + case 50: enter_config(2); break; diff --git a/citadel/citadel.h b/citadel/citadel.h index 763beeee2..b97a75979 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -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 diff --git a/citadel/citadel.rc b/citadel/citadel.rc index c209c1914..b195cac0d 100644 --- a/citadel/citadel.rc +++ b/citadel/citadel.rc @@ -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 diff --git a/citadel/domain.c b/citadel/domain.c index df44d21dd..d68a9a38c 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -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); } diff --git a/citadel/routines2.c b/citadel/routines2.c index 644f1d044..297e2f767 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -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("\ndd elete ave 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); + } +} diff --git a/citadel/routines2.h b/citadel/routines2.h index 087465bed..6f1ced38c 100644 --- a/citadel/routines2.h +++ b/citadel/routines2.h @@ -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); -- 2.30.2