From: Art Cancro Date: Thu, 23 Dec 1999 04:46:24 +0000 (+0000) Subject: * "Finished" initial hack of RFC822 import X-Git-Tag: v7.86~7378 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=8c44437f66c4faa66625cac992f1164e296b8ffd;p=citadel.git * "Finished" initial hack of RFC822 import --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 431dbaaac..6a5f745d7 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ +Revision 1.431 1999/12/23 04:46:23 ajc +* "Finished" initial hack of RFC822 import + Revision 1.430 1999/12/22 04:46:34 ajc * Fixed up the "Date:" headers to be RFC822-compliant @@ -1499,4 +1502,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 6e3ccbdea..1086361b2 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -232,7 +232,6 @@ void try_name(struct usersupp *us) { } - /* * Convert an Internet email address to a Citadel user/host combination */ @@ -315,10 +314,8 @@ int convert_field(struct CtdlMessage *msg, int beg, int end) { /* Here's the big rfc822-to-citadel loop. */ if (!strcasecmp(key, "Date")) { - lprintf(9, "converting date <%s>\n", value); sprintf(buf, "%ld", parsedate(value) ); - lprintf(9, "parsed value is <%s>\n", buf); - if (msg->cm_fields['T'] != NULL) + if (msg->cm_fields['T'] == NULL) msg->cm_fields['T'] = strdoop(buf); processed = 1; } @@ -328,11 +325,11 @@ int convert_field(struct CtdlMessage *msg, int beg, int end) { node = mallok(strlen(value)); name = mallok(strlen(value)); process_rfc822_addr(value, user, node, name); - if (msg->cm_fields['A'] != NULL) + if (msg->cm_fields['A'] == NULL) msg->cm_fields['A'] = strdoop(user); - if (msg->cm_fields['N'] != NULL) + if (msg->cm_fields['N'] == NULL) msg->cm_fields['N'] = strdoop(node); - if (msg->cm_fields['H'] != NULL) + if (msg->cm_fields['H'] == NULL) msg->cm_fields['H'] = strdoop(name); phree(user); phree(node); @@ -341,14 +338,12 @@ int convert_field(struct CtdlMessage *msg, int beg, int end) { } else if (!strcasecmp(key, "Subject")) { - if (msg->cm_fields['U'] != NULL) - msg->cm_fields['U'] = strdoop(key); + if (msg->cm_fields['U'] == NULL) + msg->cm_fields['U'] = strdoop(value); processed = 1; } /* Clean up and move on. */ - lprintf(9, "Field: key=<%s> value=<%s> processed=%d\n", - key, value, processed); phree(key); /* Don't free 'value', it's actually the same buffer */ return(processed); } @@ -375,7 +370,6 @@ struct CtdlMessage *convert_internet_message(char *rfc822) { msg->cm_format_type = 4; /* always MIME */ msg->cm_fields['M'] = rfc822; - /* FIX there's plenty to do here. */ msglen = strlen(rfc822); pos = 0; done = 0; @@ -412,7 +406,6 @@ struct CtdlMessage *convert_internet_message(char *rfc822) { if (pos > strlen(rfc822)) done = 1; } - /* Follow-up sanity checks... */ /* If there's no timestamp on this message, set it to now. */ diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index 434e23c0a..5a206e29d 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -58,7 +58,7 @@ long SYM_SMTP; */ void smtp_greeting(void) { - strcpy(CC->cs_clientname, "Citadel SMTP"); + strcpy(CC->cs_clientname, "SMTP session"); CC->internal_pgm = 1; CC->cs_flags |= CS_STEALTH; CtdlAllocUserData(SYM_SMTP, sizeof(struct citsmtp)); @@ -396,9 +396,10 @@ void smtp_data(void) { fprintf(stderr, "Converting message...\n"); msg = convert_internet_message(body); - phree(body); - CtdlSaveMsg(msg, "", BASEROOM, MES_LOCAL, 1); /* FIX temporary */ + /* FIX do something with it! */ + CtdlSaveMsg(msg, "", BASEROOM, MES_LOCAL, 1); + CtdlFreeMessage(msg); cprintf("599 command unfinished but message saved\n");