NNTP65/NNTP65.UP: Improvements to code that updates EMAIL.DB

This commit is contained in:
Bobbi Webber-Manners 2020-09-23 21:19:44 -04:00
parent cd52f1bfea
commit 569e70e7dd
2 changed files with 9 additions and 6 deletions

View File

@ -459,8 +459,9 @@ void update_mailbox(char *mbox) {
hdrs.tag = ' ';
hdrs.date[0] = hdrs.from[0] = hdrs.cc[0] = hdrs.subject[0] = '\0';
// Store News:newsgroup in TO field
strcpy(hdrs.to, "News:");
strcat(hdrs.to, newsgroup);
strcpy(filename, "News:");
strcat(filename, newsgroup);
copyheader(hdrs.to, filename, 79);
while ((chars = get_line(fp, linebuf, LINEBUFSZ)) != 0) {
if (headers) {
headerchars += chars;

View File

@ -476,12 +476,14 @@ void update_sent_mbox(char *name) {
copyheader(hdrs.from, linebuf + 6, 79);
hdrs.from[79] = '\0';
}
if (!strncmp(linebuf, "To: ", 4)) {
copyheader(hdrs.to, linebuf + 4, 79);
if (!strncmp(linebuf, "Newsgroups: ", 12)) {
strcpy(filename, "News:");
strcat(filename, linebuf + 12);
copyheader(hdrs.to, filename, 79);
hdrs.to[79] = '\0';
}
if (!strncmp(linebuf, "Cc: ", 4)) {
copyheader(hdrs.cc, linebuf + 4, 79);
if (!strncmp(linebuf, "Organization: ", 14)) {
copyheader(hdrs.cc, linebuf + 14, 79);
hdrs.cc[79] = '\0';
}
if (!strncmp(linebuf, "Subject: ", 9)) {