Fixed wrong To: address in gated newsmessages

This commit is contained in:
Michiel Broek 2002-03-27 20:12:30 +00:00
parent e6f0072fec
commit dfa2baebd3
3 changed files with 127 additions and 130 deletions

View File

@ -4675,6 +4675,8 @@ v0.33.20 10-Feb-2002
When a ticfile was received while our aka is in the path, the When a ticfile was received while our aka is in the path, the
bad tic counter wasn't increased. bad tic counter wasn't increased.
Made error message in AddMsgHdr function more clear. Made error message in AddMsgHdr function more clear.
Removed experimental patch in news->ftn gate were wrong To:
address was created.
mball: mball:
Will not crash anymore when it needs more then 10 minutes to Will not crash anymore when it needs more then 10 minutes to

View File

@ -105,6 +105,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f)
buf = calloc(4097, sizeof(char)); buf = calloc(4097, sizeof(char));
while (fgets(buf, 4096, ap)) { while (fgets(buf, 4096, ap)) {
if (strlen(buf) && isalnum(buf[0])) {
tag = strtok(buf, "\t \r\n\0"); tag = strtok(buf, "\t \r\n\0");
p = strtok(NULL, "\r\n\0"); p = strtok(NULL, "\r\n\0");
desc = p; desc = p;
@ -231,6 +232,7 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f)
msgs.Tag, msgs.Group, offset, ascfnode(f , 0x1f)); msgs.Tag, msgs.Group, offset, ascfnode(f , 0x1f));
return 0; return 0;
} /* if (strcmp(tag, Area) == 0) */ } /* if (strcmp(tag, Area) == 0) */
} /* if (strlen(buf) && isalnum(buf[0])) */
} /* while (fgets(buf, 4096, ap)) */ } /* while (fgets(buf, 4096, ap)) */
Syslog('m', "Area %s not found in taglist", Area); Syslog('m', "Area %s not found in taglist", Area);

View File

@ -228,12 +228,9 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
p = xstrcpy(hdr((char *)"X-Fidonet-Comment-To",msg)); p = xstrcpy(hdr((char *)"X-Fidonet-Comment-To",msg));
if (p == NULL) if (p == NULL)
p = xstrcpy(hdr((char *)"X-Apparently-To",msg)); p = xstrcpy(hdr((char *)"X-Apparently-To",msg));
if (p == NULL)
p = xstrcpy(hdr((char *)"Reply-To", msg));
if (p == NULL) if (p == NULL)
p = xstrcpy(hdr((char *)"To", msg)); /* 14-Aug-2001 MB */ p = xstrcpy(hdr((char *)"To", msg)); /* 14-Aug-2001 MB */
if (p) { if (p) {
Syslog('n', "getting `to' address from: \"%s\"",p);
if ((tmsg->to = parsefaddr(p)) == NULL) if ((tmsg->to = parsefaddr(p)) == NULL)
tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0"); tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0");
if ((l = strrchr(p,'<')) && (r = strchr(p,'>')) && (l < r)) { if ((l = strrchr(p,'<')) && (r = strchr(p,'>')) && (l < r)) {
@ -285,7 +282,9 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
tmsg->to->point = msgs.Aka.point; tmsg->to->point = msgs.Aka.point;
tmsg->to->domain = xstrcpy(msgs.Aka.domain); tmsg->to->domain = xstrcpy(msgs.Aka.domain);
} else { } else {
Syslog('n', "Filling default To: address"); /*
* Filling a default To: address.
*/
tmsg->to = (faddr*)malloc(sizeof(faddr)); tmsg->to = (faddr*)malloc(sizeof(faddr));
tmsg->to->name = xstrcpy((char *)"All"); tmsg->to->name = xstrcpy((char *)"All");
tmsg->to->zone = msgs.Aka.zone; tmsg->to->zone = msgs.Aka.zone;
@ -294,7 +293,7 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
tmsg->to->point = msgs.Aka.point; tmsg->to->point = msgs.Aka.point;
tmsg->to->domain = xstrcpy(msgs.Aka.domain); tmsg->to->domain = xstrcpy(msgs.Aka.domain);
} }
Syslog('n', "TO: %s",ascfnode(tmsg->to,0xff)); Syslog('N', "TO: %s",ascfnode(tmsg->to,0xff));
} else { } else {
if (recipient) { if (recipient) {
/* /*
@ -363,9 +362,7 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
while (isspace(*freename)) while (isspace(*freename))
freename++; freename++;
} }
// if (p) NOT IN IFMAIL
// free(p);
// p = NULL;
if (rfcfrom) { if (rfcfrom) {
while (isspace(*rfcfrom)) while (isspace(*rfcfrom))
rfcfrom++; rfcfrom++;
@ -389,9 +386,8 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
if ((!freename) || ((freename) && (*freename == '\0')) || (strcmp(freename,".")==0)) if ((!freename) || ((freename) && (*freename == '\0')) || (strcmp(freename,".")==0))
freename=rfcfrom; freename=rfcfrom;
// p = NULL;
if (newsmode) if (newsmode)
Syslog('n', "FROM: %s <%s>", freename, rfcfrom); Syslog('M', "FROM: %s <%s>", freename, rfcfrom);
else else
Syslog('+', "from: %s <%s>",freename,rfcfrom); Syslog('+', "from: %s <%s>",freename,rfcfrom);
@ -419,10 +415,11 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
replyaddr=NULL; replyaddr=NULL;
} }
if (needreplyaddr && (tmsg->from == NULL)) { if (needreplyaddr && (tmsg->from == NULL)) {
Syslog('m', "fill replyaddr with \"%s\"",rfcfrom); Syslog('M', "fill replyaddr with \"%s\"",rfcfrom);
replyaddr=xstrcpy(rfcfrom); replyaddr=xstrcpy(rfcfrom);
} }
if (tmsg->from)
Syslog('m', "From address was%s distinguished as ftn", tmsg->from ? "" : " not"); Syslog('m', "From address was%s distinguished as ftn", tmsg->from ? "" : " not");
if (newsmode) if (newsmode)
@ -503,11 +500,7 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
} else { } else {
tmsg->subj = xstrcpy((char *)" "); tmsg->subj = xstrcpy((char *)" ");
} }
// if (p) Syslog('M', "SUBJ: \"%s\"", tmsg->subj);
// free(p);
// p = NULL;
Syslog('m', "SUBJ: \"%s\"", tmsg->subj);
if ((p = hdr((char *)"X-FTN-FLAGS",msg))) if ((p = hdr((char *)"X-FTN-FLAGS",msg)))
tmsg->flags |= flagset(p); tmsg->flags |= flagset(p);
@ -569,7 +562,7 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
else else
tmsg->reply_a=NULL; tmsg->reply_a=NULL;
Syslog('m', "DATE: %s, MSGID: %s %lx, REPLY: %s %lx", Syslog('M', "DATE: %s, MSGID: %s %lx, REPLY: %s %lx",
ftndate(tmsg->date), MBSE_SS(tmsg->msgid_a),tmsg->msgid_n, MBSE_SS(tmsg->reply_a),tmsg->reply_n); ftndate(tmsg->date), MBSE_SS(tmsg->msgid_a),tmsg->msgid_n, MBSE_SS(tmsg->reply_a),tmsg->reply_n);
p = hdr((char *)"Organization",msg); p = hdr((char *)"Organization",msg);
@ -589,7 +582,7 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *reci
tmsg->origin = xstrcpy(CFG.origin); tmsg->origin = xstrcpy(CFG.origin);
} }
Syslog('m', "ORIGIN: %s", MBSE_SS(tmsg->origin)); Syslog('M', "ORIGIN: %s", MBSE_SS(tmsg->origin));
return tmsg; return tmsg;
} }