From: Art Cancro Date: Tue, 4 Aug 1998 22:32:42 +0000 (+0000) Subject: Altered the translation of incoming Internet e-mail addresses to Citadel X-Git-Tag: v7.86~8401 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=a98cfb898bb3907f827586ac49e47810e2216e62;p=citadel.git Altered the translation of incoming Internet e-mail addresses to Citadel addresses. --- diff --git a/citadel/citmail.c b/citadel/citmail.c index 849871387..12df37a60 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -55,6 +55,21 @@ 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[]; { int a,b,cpos,tend,tval; @@ -154,6 +169,42 @@ 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[]; { @@ -170,7 +221,7 @@ void host_alias(char host[]) { int a; /* What name is the local host known by? */ - /* if (!strcasecmp(host, config.c_fqdn)) { */ + /* if (!strucmp(host, config.c_fqdn)) { */ if (IsHostLocal(host)) { strcpy(host, config.c_nodename); return; @@ -178,7 +229,7 @@ void host_alias(char host[]) { /* Other hosts in the gateway domain? */ for (a=0; a0) { fprintf(temp,"U%s",subject); putc(0,temp); } + + /* FIX we have to figure out how to handle metoo list loops */ + if (IsHostLocal(nodebuf)) { + fprintf(temp, "C%s%c", "spoo", 0); + } + putc('M',temp); if (strcmp(buf, ".")) loopcopy(temp, stdin); putc(0,temp); @@ -503,7 +561,7 @@ char *name; { for (a=0; a 0) { printf("571 Multiple recipients not supported.\n"); } @@ -675,10 +740,10 @@ char *argv[]; { - else if (!strncasecmp(buf, "RCPT", 4)) { + else if (!struncmp(buf, "RCPT", 4)) { printf("501 Only 'To:' commands are supported.\n"); } - else if (!strncasecmp(buf, "DATA", 4)) { + else if (!struncmp(buf, "DATA", 4)) { if (strlen(recp) > 0) { printf("354 Sock it to me, baby...\n"); fflush(stdout); @@ -693,7 +758,7 @@ char *argv[]; { printf("500 Huh?\n"); } - } while (strncasecmp(buf,"QUIT",4)); + } while (struncmp(buf,"QUIT",4)); } else {