Commit 6cdb6d6a authored by rswindell's avatar rswindell
Browse files

Fix long-standing bug with routed (re-packed) netmail messages:

The orig address in the packed msg header is (and still is) the proper
local system address (this may be correct behavior, still checking), but
no INTL control line (FSC-0004) was added, so the packed message header
ends up defining the originating system address. So, now we include an
INTL control line in packed netmail messages which reflects the actual
origin address of the message. Thanks to Nigel Reed for helping to identify
and test this problem over the past week or so.
parent 3cecd734
......@@ -190,6 +190,14 @@ char* parse_control_line(const char* fmsgbuf, const char* kludge)
return strdup(p);
}
int fwrite_intl_control_line(FILE* fp, fmsghdr_t* hdr)
{
return fprintf(fp,"\1INTL %hu:%hu/%hu %hu:%hu/%hu\r"
,hdr->destzone,hdr->destnet,hdr->destnode
,hdr->origzone,hdr->orignet,hdr->orignode);
}
typedef struct echostat_msg {
char msg_id[128];
char reply_id[128];
......@@ -1107,9 +1115,7 @@ int create_netmail(const char *to, const smbmsg_t* msg, const char *subject, con
SAFECOPY(hdr.subj,subject);
fwrite(&hdr,sizeof(fmsghdr_t),1,fp);
fprintf(fp,"\1INTL %hu:%hu/%hu %hu:%hu/%hu\r"
,hdr.destzone,hdr.destnet,hdr.destnode
,hdr.origzone,hdr.orignet,hdr.orignode);
fwrite_intl_control_line(fp, &hdr);
if(!fidoctrl_line_exists(msg, "TZUTC:")) {
/* TZUTC (FSP-1001) */
......@@ -3533,6 +3539,9 @@ void putfmsg(FILE* stream, const char* fbuf, fmsghdr_t fmsghdr, area_t area
fwrite(fmsghdr.from ,strlen(fmsghdr.from)+1 ,1,stream);
fwrite(fmsghdr.subj ,strlen(fmsghdr.subj)+1 ,1,stream);
if(area.tag == NULL) /* NetMail, so add FSC-0004 INTL kludge */
fwrite_intl_control_line(stream, &fmsghdr);
len = strlen((char *)fbuf);
/* Write message body */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment