* "Finished" initial hack of RFC822 import
authorArt Cancro <ajc@citadel.org>
Thu, 23 Dec 1999 04:46:24 +0000 (04:46 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 23 Dec 1999 04:46:24 +0000 (04:46 +0000)
citadel/ChangeLog
citadel/internet_addressing.c
citadel/serv_smtp.c

index 431dbaaacd036dc5b4fbb081e1bd618da769f6db..6a5f745d743eb002e32d33c5c8c4d715d70ec502 100644 (file)
@@ -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 <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 6e3ccbdeaf62243791c6ce3d0a762f13d85717f4..1086361b25255415178aeeb1ff81c27c28354b91 100644 (file)
@@ -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. */
index 434e23c0a4584749b282d0d61c361f36af2d273f..5a206e29d0dc0d277ffeb65f6c303e2d0bc41fa0 100644 (file)
@@ -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");