From 533ce0b634354347aac14b11c797714a5232dfc3 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 14 Aug 2005 16:04:13 +0000 Subject: [PATCH] Gate updates --- mbfido/ftn2rfc.c | 68 +++++++++++++++++++++++++----------------------- mbfido/rfc2ftn.c | 25 ++++++++++-------- 2 files changed, 49 insertions(+), 44 deletions(-) diff --git a/mbfido/ftn2rfc.c b/mbfido/ftn2rfc.c index 25cba3eb..14eedc5d 100644 --- a/mbfido/ftn2rfc.c +++ b/mbfido/ftn2rfc.c @@ -726,41 +726,43 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl /* * Build Path: headerline */ - q = xstrcpy((char *)"Path: "); - if (CFG.newsfeed == FEEDUUCP) { - /* - * If we don't run our own newsserver we have to simulate and - * add the UUCP nodename here. - */ - memset(&utsbuf, 0, sizeof(utsbuf)); - if (uname(&utsbuf)) { - WriteError("Can't get system nodename"); - } else { - q = xstrcat(q, utsbuf.nodename); - q = xstrcat(q, (char *)"!"); + if (CFG.newsfeed != FEEDINN) { + q = xstrcpy((char *)"Path: "); + if (CFG.newsfeed == FEEDUUCP) { + /* + * If we don't run our own newsserver we have to simulate and + * add the UUCP nodename here. + */ + memset(&utsbuf, 0, sizeof(utsbuf)); + if (uname(&utsbuf)) { + WriteError("Can't get system nodename"); + } else { + q = xstrcat(q, utsbuf.nodename); + q = xstrcat(q, (char *)"!"); + } } - } - tfaddr = fido2faddr(msgs.Aka); - q = xstrcat(q, ascinode(tfaddr, 0x07)); - tidy_faddr(tfaddr); - q = xstrcat(q, (char *)"!"); - if (ftnpath) - for (tfa=ftnpath->next;tfa;tfa=tfa->next) { - /* FIXME: possible memory leak */ - q = xstrcat(q, ascinode(tfa->addr,0x1f)); - q = xstrcat(q, (char *)"!"); - } - tidy_falist(&ftnpath); + tfaddr = fido2faddr(msgs.Aka); + q = xstrcat(q, ascinode(tfaddr, 0x07)); + tidy_faddr(tfaddr); + q = xstrcat(q, (char *)"!"); + if (ftnpath) + for (tfa=ftnpath->next;tfa;tfa=tfa->next) { + /* FIXME: possible memory leak */ + q = xstrcat(q, ascinode(tfa->addr,0x1f)); + q = xstrcat(q, (char *)"!"); + } + tidy_falist(&ftnpath); - if (p) { - while (isspace(*p)) - p++; - q = xstrcat(q, p); - } else - q = xstrcat(q, (char *)"not-for-mail"); - sprintf(temp, "%s\n", q); - Send(newsmode, temp); - free(q); + if (p) { + while (isspace(*p)) + p++; + q = xstrcat(q, p); + } else + q = xstrcat(q, (char *)"not-for-mail"); + sprintf(temp, "%s\n", q); + Send(newsmode, temp); + free(q); + } if ((p = hdr((char *)"Newsgroups",msg))) { /* diff --git a/mbfido/rfc2ftn.c b/mbfido/rfc2ftn.c index ee45f0a7..342bfff8 100644 --- a/mbfido/rfc2ftn.c +++ b/mbfido/rfc2ftn.c @@ -162,15 +162,18 @@ int findorigmsg(char *msgid, char *o) return 0; } - strcpy(currentgroup,msgs.Newsgroup); + strcpy(currentgroup, msgs.Newsgroup); start = MsgBase.Lowest; end = MsgBase.Highest; gen2 = calloc(strlen(msgid)+1,sizeof(char)); strcpy(gen2, strchr(msgid,'<')); + Syslog('m', "findorigmsg(%s): gen2=%s", msgid, gen2); + for (i = start; i <= end; i++) { if (Msg_ReadHeader(i)) { - if (strncmp(gen2,make_msgid(Msg.Msgid),strlen(gen2)-1) == 0) { +// Syslog('m', "findorigmsg() %d, %s / %s (%s)", i, gen2, make_msgid(Msg.Msgid), Msg.Msgid); + if (strncmp(gen2, make_msgid(Msg.Msgid),strlen(gen2)-1) == 0) { Syslog('m',"Found msgid: %s",make_msgid(Msg.Msgid)); // realloc(o,(strlen(Msg.Msgid)+1)* sizeof(char)); strcpy(o,Msg.Msgid); @@ -252,16 +255,16 @@ int rfc2ftn(FILE *fp, faddr *recipient) ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area); //Griffin - fmsg->reply_s = calloc(256,sizeof(char)); +// fmsg->reply_s = calloc(256,sizeof(char)); - if (findorigmsg(p, fmsg->reply_s)) { - fmsg->to->name = calloc(strlen(Msg.From)+1, sizeof(char)); - strcpy(fmsg->to->name, Msg.From); - Syslog('m', "fmsg to-name %s", fmsg->to->name); - Syslog('m', "reply_s %s", fmsg->reply_s); - } else { - Syslog('m', "findorigmsg nothing found"); - } +// if (findorigmsg(p, fmsg->reply_s)) { +// fmsg->to->name = calloc(strlen(Msg.From)+1, sizeof(char)); +// strcpy(fmsg->to->name, Msg.From); +// Syslog('m', "fmsg to-name %s", fmsg->to->name); +// Syslog('m', "reply_s %s", fmsg->reply_s); +// } else { +// Syslog('m', "findorigmsg nothing found"); +// } if (!chkftnmsgid(p)) { hash_update_s(&fmsg->reply_n, fmsg->area);