}
-
/*
* Convert an Internet email address to a Citadel user/host combination
*/
/* 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;
}
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);
}
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);
}
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;
if (pos > strlen(rfc822)) done = 1;
}
-
/* Follow-up sanity checks... */
/* If there's no timestamp on this message, set it to now. */
*/
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));
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");