From c2beadb361132e37fc71c5586e5850a50886360a Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 5 Aug 1998 02:39:39 +0000 Subject: [PATCH] Changes required in order to handle the new translation paradigm for Internet addresses being converted into Citadel addresses. Also cleaned up citmail.c to not look at any local databases, but instead feed blindly into netproc. --- citadel/citmail.c | 180 ++++++++++----------------------------------- citadel/messages.c | 4 +- 2 files changed, 38 insertions(+), 146 deletions(-) diff --git a/citadel/citmail.c b/citadel/citmail.c index 12df37a60..720b4ed95 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -55,20 +55,6 @@ char TABLEFILE[128]; char OUTGOING_FQDN[128]; int RUN_NETPROC = 1; -int struncmp(lstr,rstr,l) -char lstr[],rstr[]; { - int pos = 0; - char lc,rc; - while (1) { - if (pos==l) return(0); - lc=tolower(lstr[pos]); - rc=tolower(rstr[pos]); - if ((lc==0)&&(rc==0)) return(0); - if (lcrc) return(1); - pos=pos+1; - } - } long conv_date(sdbuf) char sdbuf[]; { @@ -169,42 +155,6 @@ char buf[]; { buf[strlen(buf)-1]=0; } -int islocalok(char recp[]) { - - struct usersupp ust; - long lookfor; - char a_recp[128]; - int found_closest_match = 0; - int a,us; - strcpy(a_recp,recp); - for (a=0; a=0) { - while(read(us,&ust,sizeof(struct usersupp))>0) { - if (lookfor == ust.eternal) { - strcpy(recp,ust.fullname); - close(us); - return(2); - } - if (!strucmp(ust.fullname,a_recp)) { - strcpy(recp,ust.fullname); - close(us); - return(3); - } - if (!struncmp(ust.fullname,a_recp,strlen(a_recp))) { - strcpy(recp,ust.fullname); - found_closest_match = 1; - } - } - close(us); - } - if (getpwnam(recp)!=NULL) return(1); - if (found_closest_match) return(3); - return(0); - } - /* strip leading and trailing spaces */ void striplt(buf) char buf[]; { @@ -221,7 +171,7 @@ void host_alias(char host[]) { int a; /* What name is the local host known by? */ - /* if (!strucmp(host, config.c_fqdn)) { */ + /* if (!strcasecmp(host, config.c_fqdn)) { */ if (IsHostLocal(host)) { strcpy(host, config.c_nodename); return; @@ -229,7 +179,7 @@ void host_alias(char host[]) { /* Other hosts in the gateway domain? */ for (a=0; a 0) { + fprintf(temp, "O%s%c", targetroom, 0); + } + else { + fprintf(temp, "OMail%c", 0); + } + fprintf(temp,"N%s%c", nodebuf, 0); fprintf(temp,"H%s%c", frombuf, 0); if (dtype==REMOTE) { fprintf(temp,"D%s%c", destsys, 0); } - fprintf(temp,"R%s%c", recp, 0); - if (strlen(subject)>0) { - fprintf(temp,"U%s%c", subject, 0); - } - putc('M',temp); - if (strcmp(buf, ".")) loopcopy(temp, stdin); - putc(0,temp); - fclose(temp); - } - -void do_roommail(recp) /* pipe public message through netproc */ -char recp[]; { - long now; - FILE *temp; - int a; - char buf[128],userbuf[128],frombuf[128],nodebuf[128]; - char subject[128], from[256]; - strcpy(subject,""); - sprintf(from, "postmaster@%s", config.c_nodename); - strcpy(recp,&recp[5]); - for (a=0; a0) { - fprintf(temp,"U%s",subject); putc(0,temp); + if (strlen(recp) > 0) { + fprintf(temp,"R%s%c", recp, 0); } - /* FIX we have to figure out how to handle metoo list loops */ - if (IsHostLocal(nodebuf)) { - fprintf(temp, "C%s%c", "spoo", 0); + if (strlen(subject)>0) { + fprintf(temp,"U%s%c", subject, 0); } - putc('M',temp); if (strcmp(buf, ".")) loopcopy(temp, stdin); putc(0,temp); fclose(temp); } + void do_uudecode(target) char *target; { static char buf[1024]; @@ -532,18 +451,6 @@ char *target; { } -void do_fallback(recp) -char recp[]; { - static char buf[1024]; - FILE *fp; - - sprintf(buf, FALLBACK, recp); - fp=popen(buf,"w"); - if (fp==NULL) fp = popen("cat >/dev/null", "w"); - loopcopy(fp, stdin); - pclose(fp); - } - int alias(name) char *name; { FILE *fp; @@ -561,7 +468,7 @@ char *name; { for (a=0; a 0) { printf("571 Multiple recipients not supported.\n"); } @@ -740,10 +634,10 @@ char *argv[]; { - else if (!struncmp(buf, "RCPT", 4)) { + else if (!strncasecmp(buf, "RCPT", 4)) { printf("501 Only 'To:' commands are supported.\n"); } - else if (!struncmp(buf, "DATA", 4)) { + else if (!strncasecmp(buf, "DATA", 4)) { if (strlen(recp) > 0) { printf("354 Sock it to me, baby...\n"); fflush(stdout); @@ -758,7 +652,7 @@ char *argv[]; { printf("500 Huh?\n"); } - } while (struncmp(buf,"QUIT",4)); + } while (strncasecmp(buf,"QUIT",4)); } else { diff --git a/citadel/messages.c b/citadel/messages.c index d5bc7de50..b3a9cf16a 100644 --- a/citadel/messages.c +++ b/citadel/messages.c @@ -379,8 +379,6 @@ int read_message(long int num, char pagin) /* Read a message from the server */ if (!struncmp(buf,"from=",5)) { printf("from %s ",&buf[5]); } - if (!struncmp(buf,"path=",5)) - strcpy(reply_to,&buf[5]); if (!struncmp(buf,"subj=",5)) strcpy(m_subject,&buf[5]); if ((!struncmp(buf,"hnod=",5)) @@ -402,7 +400,7 @@ int read_message(long int num, char pagin) /* Read a message from the server */ { strcpy(reply_to,from); } - else if (haschar(&buf[5],'.')==0) { + else { sprintf(reply_to,"%s @ %s",from,&buf[5]); } } -- 2.39.2