Skip to content
Snippets Groups Projects
Commit a1e12784 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Don't repeate mail "comment" headers in exported netmail msgs

smb_getmsgtxt() returns any "comment" headers as part of the message body text, and has since 2003.
When I added mail->netmail (stored message) export support to SBBSecho v3, I duplicated this logic, so comment headers were added *twice* to exported netmail messages. Oops. I didn't notice until today when playing with forwarding-to-netmail (FTN).

Also noticed and fixed: any comment headers in posted messages (unlikely/uncommon) would not be exported to EchoMail messages. Use the correct smb_getmsgtxt() mode flags ("NO_TAILS" instead of "BODY_ONLY") - I know, not great names.
parent 459e38de
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #980 passed
......@@ -1262,10 +1262,6 @@ int create_netmail(const char *to, const smbmsg_t* msg, const char *subject, con
fprintf(fp, "\1CHRS: %s\r", charset);
if(msg->editor != NULL)
fprintf(fp, "\1NOTE: %s\r", msg->editor);
/* comment headers are part of text */
for(i=0; i<msg->total_hfields; i++)
if(msg->hfield[i].type == SMB_COMMENT)
fprintf(fp, "%s\r", (char*)msg->hfield_dat[i]);
if(subject != msg->subj)
fprintf(fp, "Subject: %s\r\r", msg->subj);
}
......@@ -5142,7 +5138,7 @@ bool retoss_bad_echomail(void)
continue;
}
char* body = smb_getmsgtxt(&badsmb, &badmsg, GETMSGTXT_BODY_ONLY);
char* body = smb_getmsgtxt(&badsmb, &badmsg, GETMSGTXT_NO_TAILS);
if(body == NULL) {
smb_unlockmsghdr(&badsmb,&badmsg);
smb_freemsgmem(&badmsg);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment