Finished mbnntpd

This commit is contained in:
Michiel Broek 2004-05-11 14:28:40 +00:00
parent 0119dbe0f2
commit 1198c0465b
4 changed files with 7 additions and 34 deletions

View File

@ -61,8 +61,8 @@ v0.51.4 11-Apr-2004
used if configured with --enable-experiment. used if configured with --enable-experiment.
mbnntp: mbnntp:
New program, news server to read echomail with a news client. New program, news server to read/write echomail with a news
Reading news works, posts partial tested. client. Users must be registered bbs users.
mbsebbs: mbsebbs:
Added logging of virus scanner results. Added logging of virus scanner results.

View File

@ -14,7 +14,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<div align="right"><h5>Last update 13-Apr-2004</h5></div> <div align="right"><h5>Last update 11-May-2004</h5></div>
<div align="center"><H1>mbnntp - News server</H1></div> <div align="center"><H1>mbnntp - News server</H1></div>
<H3>Synopsis.</H3> <H3>Synopsis.</H3>
@ -29,7 +29,7 @@ commandline, instead it should be run by <b>inetd</b> or <b>xinetd</b>.
the bbs echomail and news areas. To use the server, the user must login in the the bbs echomail and news areas. To use the server, the user must login in the
news server with his bbs unix name and password, thus the user must exist on the news server with his bbs unix name and password, thus the user must exist on the
bbs. The access to the areas is the same as if the user would be logged into the bbs. The access to the areas is the same as if the user would be logged into the
bbs. bbs. Only echomail areas are available to the user as newsgroups.
<P>&nbsp;<P> <P>&nbsp;<P>
<H3>Installation.</H3> <H3>Installation.</H3>
@ -44,7 +44,6 @@ nntp stream tcp nowait mbse /opt/mbse/bin/mbnntp mbnntp
<H3>Bugs.</H3> <H3>Bugs.</H3>
<P> <P>
POST not yet implemented.<br>
Maybe a lot, this is a new program. Maybe a lot, this is a new program.
<P> <P>

View File

@ -192,7 +192,7 @@ void command_abhs(char *buf)
send_nntp("From: %s <%s>", Msg.From, Msg.FromAddress); send_nntp("From: %s <%s>", Msg.From, Msg.FromAddress);
send_nntp("Newsgroups: %s", currentgroup); send_nntp("Newsgroups: %s", currentgroup);
send_nntp("Subject: %s", Msg.Subject); send_nntp("Subject: %s", Msg.Subject);
send_nntp("Date: %s", rfcdate(Msg.Written)); send_nntp("Date: %s", rfcdate(Msg.Written + (gmt_offset((time_t)0) * 60)));
send_nntp("Message-ID: %s", make_msgid(Msg.Msgid)); send_nntp("Message-ID: %s", make_msgid(Msg.Msgid));
if (strlen(Msg.Replyid)) if (strlen(Msg.Replyid))
send_nntp("References: %s", make_msgid(Msg.Replyid)); send_nntp("References: %s", make_msgid(Msg.Replyid));
@ -211,7 +211,6 @@ void command_abhs(char *buf)
} while ((p = (char *)MsgText_Next()) != NULL); } while ((p = (char *)MsgText_Next()) != NULL);
} }
// send_nntp("X-JAM-Attributes:");
send_nntp("MIME-Version: 1.0"); send_nntp("MIME-Version: 1.0");
send_nntp("Content-Type: text/plain; charset=iso-8859-1; format=fixed"); send_nntp("Content-Type: text/plain; charset=iso-8859-1; format=fixed");
send_nntp("Content-Transfer-Encoding: 8bit"); send_nntp("Content-Transfer-Encoding: 8bit");
@ -590,7 +589,7 @@ void command_xover(char *cmd)
if (strlen(Msg.Replyid)) if (strlen(Msg.Replyid))
sprintf(reply, "%s", make_msgid(Msg.Replyid)); sprintf(reply, "%s", make_msgid(Msg.Replyid));
send_nntp("%lu\t%s\t%s <%s>\t%s\t%s\t%s\t%d\t%d", i, Msg.Subject, Msg.From, Msg.FromAddress, send_nntp("%lu\t%s\t%s <%s>\t%s\t%s\t%s\t%d\t%d", i, Msg.Subject, Msg.From, Msg.FromAddress,
rfcdate(Msg.Written), msgid, reply, bytecount, linecount); rfcdate(Msg.Written + (gmt_offset((time_t)0) * 60)), msgid, reply, bytecount, linecount);
} }
} }
send_nntp("."); send_nntp(".");

View File

@ -134,12 +134,6 @@ int rfc2ftn(FILE *fp)
temp = calloc(4097, sizeof(char)); temp = calloc(4097, sizeof(char));
Syslog('m', "Entering rfc2ftn"); Syslog('m', "Entering rfc2ftn");
rewind(fp); rewind(fp);
Syslog('m', "========== RFC Start");
while ((fgets(temp, 4095, fp)) != NULL) {
Syslogp('m', printable(temp, 0));
}
Syslog('m', "========== RFC end");
rewind(fp);
msg = parsrfc(fp); msg = parsrfc(fp);
newsmode = hdr((char *)"Newsgroups", msg) ?TRUE:FALSE; newsmode = hdr((char *)"Newsgroups", msg) ?TRUE:FALSE;
@ -314,16 +308,7 @@ int rfc2ftn(FILE *fp)
return 1; return 1;
} }
if (newsmode) { fprintf(ofp, "AREA:%s\n", msgs.Tag);
fprintf(ofp, "AREA:%s\n", msgs.Tag);
} else {
if (fmsg->to->point != 0)
fprintf(ofp, "\001TOPT %d\n", fmsg->to->point);
if (fmsg->from->point != 0)
fprintf(ofp, "\001FMPT %d\n", fmsg->from->point);
fprintf(ofp, "\001INTL %d:%d/%d %d:%d/%d\n", fmsg->to->zone, fmsg->to->net, fmsg->to->node,
fmsg->from->zone, fmsg->from->net, fmsg->from->node);
}
fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n); fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n);
if (fmsg->reply_s) if (fmsg->reply_s)
fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s); fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s);
@ -450,16 +435,6 @@ int rfc2ftn(FILE *fp)
kludgewrite(tmp->val,ofp); kludgewrite(tmp->val,ofp);
} }
/*
* Add the Received: header from this system to the mesage.
*/
if (!newsmode) {
Now = time(NULL);
fprintf(ofp, "\1RFC-Received: by %s (mbfido) via RFC2FTN; %s\n", CFG.sysdomain, rfcdate(Now));
hdrsize += 72+strlen(CFG.sysdomain);
}
for (tmp = msg; tmp; tmp = tmp->next) { for (tmp = msg; tmp; tmp = tmp->next) {
if ((needputrfc(tmp, newsmode) == 1)) { if ((needputrfc(tmp, newsmode) == 1)) {
if (strcasestr((char *)"X-Origin-Newsgroups",tmp->key)) { if (strcasestr((char *)"X-Origin-Newsgroups",tmp->key)) {