From 419900fb1ff6d0d7fcd0e293a49e2d842932a1bf Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 18 Feb 2000 05:10:50 +0000 Subject: [PATCH] * Made the <.ASI> command a bit friendlier. * SMTP sender now pays attention to "smarthost" entries in the system's Internet configuration, using them if one or more is present. --- citadel/ChangeLog | 6 ++++++ citadel/domain.c | 50 +++++++++++++++++++++++++++++++++++++-------- citadel/domain.h | 1 + citadel/msgbase.c | 2 +- citadel/routines2.c | 24 ++++++++++++++++++++-- 5 files changed, 72 insertions(+), 11 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index b32753cc2..388dac6b4 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,9 @@ $Log$ +Revision 1.463 2000/02/18 05:10:50 ajc +* Made the <.ASI> command a bit friendlier. +* SMTP sender now pays attention to "smarthost" entries in the system's + Internet configuration, using them if one or more is present. + Revision 1.462 2000/02/17 05:27:39 ajc * Got the "MAIL From:" command sending the correct data. (unnnhhhhnnhhhh...) @@ -1635,3 +1640,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/domain.c b/citadel/domain.c index 0f61f4a44..129b2efa3 100644 --- a/citadel/domain.c +++ b/citadel/domain.c @@ -8,8 +8,43 @@ #include "citadel.h" #include "domain.h" #include "server.h" +#include "tools.h" +#include "internet_addressing.h" + + +/* + * get_smarthosts() checks the Internet configuration for "smarthost" + * entries and returns them in the same format as getmx() does -- fill the + * buffer with a delimited list of hosts and return the number of hosts. + */ +int get_smarthosts(char *mxbuf) { + int config_lines; + int i; + char buf[256]; + char host[256], type[256]; + int total_smarthosts = 0; + + if (inetcfg == NULL) return(0); + strcpy(mxbuf, ""); + + config_lines = num_tokens(inetcfg, '\n'); + for (i=0; i 0) return(n); - /* No smart-host? Look up the best MX for a site. + /* + * No smart-host? Look up the best MX for a site. */ ret = res_query( dest, diff --git a/citadel/domain.h b/citadel/domain.h index b20941725..d81060421 100644 --- a/citadel/domain.h +++ b/citadel/domain.h @@ -4,4 +4,5 @@ struct mx { char host[1024]; }; +int get_smarthosts(char *mxbuf); int getmx(char *mxbuf, char *dest); diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 107dcccff..067d4e28c 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1003,7 +1003,7 @@ int CtdlOutputMsg(long msg_num, /* message number (local) to fetch */ if (do_proto) cprintf("text\n"); if (mode == MT_RFC822) { if (TheMessage->cm_fields['U'] == NULL) { - cprintf("Subject: FIX bogus subject FIX%s", nl); + cprintf("Subject: (no subject)%s", nl); } cprintf("%s", nl); } diff --git a/citadel/routines2.c b/citadel/routines2.c index 4e43f3119..23537c9b3 100644 --- a/citadel/routines2.c +++ b/citadel/routines2.c @@ -746,6 +746,27 @@ void do_system_configuration(void) } +/* + * support function for do_internet_configuration() + */ +void get_inet_rec_type(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"); + sel = intprompt("Which one", 1, 1, 3); + switch(sel) { + case 1: strcpy(buf, "localhost"); + return; + case 2: strcpy(buf, "gatewaydomain"); + return; + case 3: strcpy(buf, "smarthost"); + return; + } +} + + /* * Internet mail configuration */ @@ -809,8 +830,7 @@ void do_internet_configuration(void) { newprompt("Enter host name: ", buf, 50); strcat(buf, "|"); - newprompt("Enter record type: ", - &buf[strlen(buf)], 20); + get_inet_rec_type(&buf[strlen(buf)]); recs[num_recs-1] = strdup(buf); break; case 'd': -- 2.39.2