Gate updates

This commit is contained in:
Michiel Broek 2005-08-14 16:04:13 +00:00
parent 2b24f98a15
commit 533ce0b634
2 changed files with 49 additions and 44 deletions

View File

@ -726,41 +726,43 @@ int ftn2rfc(faddr *f, faddr *t, char *subj, char *origline, time_t mdate, int fl
/* /*
* Build Path: headerline * Build Path: headerline
*/ */
q = xstrcpy((char *)"Path: "); if (CFG.newsfeed != FEEDINN) {
if (CFG.newsfeed == FEEDUUCP) { 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. * 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)) { memset(&utsbuf, 0, sizeof(utsbuf));
WriteError("Can't get system nodename"); if (uname(&utsbuf)) {
} else { WriteError("Can't get system nodename");
q = xstrcat(q, utsbuf.nodename); } else {
q = xstrcat(q, (char *)"!"); q = xstrcat(q, utsbuf.nodename);
q = xstrcat(q, (char *)"!");
}
} }
} tfaddr = fido2faddr(msgs.Aka);
tfaddr = fido2faddr(msgs.Aka); q = xstrcat(q, ascinode(tfaddr, 0x07));
q = xstrcat(q, ascinode(tfaddr, 0x07)); tidy_faddr(tfaddr);
tidy_faddr(tfaddr); q = xstrcat(q, (char *)"!");
q = xstrcat(q, (char *)"!"); if (ftnpath)
if (ftnpath) for (tfa=ftnpath->next;tfa;tfa=tfa->next) {
for (tfa=ftnpath->next;tfa;tfa=tfa->next) { /* FIXME: possible memory leak */
/* FIXME: possible memory leak */ q = xstrcat(q, ascinode(tfa->addr,0x1f));
q = xstrcat(q, ascinode(tfa->addr,0x1f)); q = xstrcat(q, (char *)"!");
q = xstrcat(q, (char *)"!"); }
} tidy_falist(&ftnpath);
tidy_falist(&ftnpath);
if (p) { if (p) {
while (isspace(*p)) while (isspace(*p))
p++; p++;
q = xstrcat(q, p); q = xstrcat(q, p);
} else } else
q = xstrcat(q, (char *)"not-for-mail"); q = xstrcat(q, (char *)"not-for-mail");
sprintf(temp, "%s\n", q); sprintf(temp, "%s\n", q);
Send(newsmode, temp); Send(newsmode, temp);
free(q); free(q);
}
if ((p = hdr((char *)"Newsgroups",msg))) { if ((p = hdr((char *)"Newsgroups",msg))) {
/* /*

View File

@ -162,15 +162,18 @@ int findorigmsg(char *msgid, char *o)
return 0; return 0;
} }
strcpy(currentgroup,msgs.Newsgroup); strcpy(currentgroup, msgs.Newsgroup);
start = MsgBase.Lowest; start = MsgBase.Lowest;
end = MsgBase.Highest; end = MsgBase.Highest;
gen2 = calloc(strlen(msgid)+1,sizeof(char)); gen2 = calloc(strlen(msgid)+1,sizeof(char));
strcpy(gen2, strchr(msgid,'<')); strcpy(gen2, strchr(msgid,'<'));
Syslog('m', "findorigmsg(%s): gen2=%s", msgid, gen2);
for (i = start; i <= end; i++) { for (i = start; i <= end; i++) {
if (Msg_ReadHeader(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)); Syslog('m',"Found msgid: %s",make_msgid(Msg.Msgid));
// realloc(o,(strlen(Msg.Msgid)+1)* sizeof(char)); // realloc(o,(strlen(Msg.Msgid)+1)* sizeof(char));
strcpy(o,Msg.Msgid); strcpy(o,Msg.Msgid);
@ -252,16 +255,16 @@ int rfc2ftn(FILE *fp, faddr *recipient)
ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area); ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area);
//Griffin //Griffin
fmsg->reply_s = calloc(256,sizeof(char)); // fmsg->reply_s = calloc(256,sizeof(char));
if (findorigmsg(p, fmsg->reply_s)) { // if (findorigmsg(p, fmsg->reply_s)) {
fmsg->to->name = calloc(strlen(Msg.From)+1, sizeof(char)); // fmsg->to->name = calloc(strlen(Msg.From)+1, sizeof(char));
strcpy(fmsg->to->name, Msg.From); // strcpy(fmsg->to->name, Msg.From);
Syslog('m', "fmsg to-name %s", fmsg->to->name); // Syslog('m', "fmsg to-name %s", fmsg->to->name);
Syslog('m', "reply_s %s", fmsg->reply_s); // Syslog('m', "reply_s %s", fmsg->reply_s);
} else { // } else {
Syslog('m', "findorigmsg nothing found"); // Syslog('m', "findorigmsg nothing found");
} // }
if (!chkftnmsgid(p)) { if (!chkftnmsgid(p)) {
hash_update_s(&fmsg->reply_n, fmsg->area); hash_update_s(&fmsg->reply_n, fmsg->area);