Fixed some problems with UUCP gating

This commit is contained in:
Michiel Broek 2002-07-14 16:20:28 +00:00
parent a866d734e5
commit 54f228d5b6
3 changed files with 385 additions and 376 deletions

View File

@ -23,6 +23,7 @@ v0.35.03 06-Jul-2002
rollover. rollover.
When a new tic area was created the first file received for When a new tic area was created the first file received for
that area was refused. that area was refused.
Fixed a few problems with local UUCP created netmails.
newuser: newuser:
Check for Unix accounts is now case sensitive. Check for Unix accounts is now case sensitive.
@ -32,6 +33,7 @@ v0.35.03 06-Jul-2002
Check existing usernames now also checks handles. Check existing usernames now also checks handles.
When a user paged the sysop for a chat, after the timer was When a user paged the sysop for a chat, after the timer was
expired, the bbs crashed. expired, the bbs crashed.
Fixed a problem with extra spaces in UUCP replyto address.
mbtask: mbtask:
Changed logging of multiple logmessages that are equal. Changed logging of multiple logmessages that are equal.

View File

@ -781,17 +781,14 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl)
*/ */
void ExportNet(unsigned long MsgNum, int UUCPgate) void ExportNet(unsigned long MsgNum, int UUCPgate)
{ {
char *p, *q, ext[4], fromname[37]; char *p, *q, ext[4], fromname[37], flavor, MailFrom[128], MailTo[128];
int i, rc, flags = 0, first; int i, rc, flags = 0, first, is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE;
FILE *qp, *fp; FILE *qp, *fp;
fidoaddr Dest, Route, *dest; fidoaddr Dest, Route, *dest;
time_t now; time_t now;
struct tm *tm; struct tm *tm;
char flavor;
faddr *from, *too, *ta; faddr *from, *too, *ta;
int is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE;
unsigned short point; unsigned short point;
char MailFrom[128], MailTo[128];
Syslog('m', "Export netmail to %s of %s (%s) %s mode", Msg.To, Msg.ToAddress, Syslog('m', "Export netmail to %s of %s (%s) %s mode", Msg.To, Msg.ToAddress,
(Msg.Crash || Msg.Direct || Msg.FileAttach) ? "Direct" : "Routed", UUCPgate ? "UUCP" : "Netmail"); (Msg.Crash || Msg.Direct || Msg.FileAttach) ? "Direct" : "Routed", UUCPgate ? "UUCP" : "Netmail");
@ -823,14 +820,12 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
if ((!strcmp(Msg.To, "UUCP")) && (is_local(ta))) { if ((!strcmp(Msg.To, "UUCP")) && (is_local(ta))) {
tidy_faddr(ta); tidy_faddr(ta);
most_debug = TRUE; most_debug = TRUE;
Syslog('m', "We are the UUCP gate");
Syslog('m', "From %s FromAddress %s", Msg.From, Msg.FromAddress);
if ((fp = tmpfile()) == NULL) { if ((fp = tmpfile()) == NULL) {
WriteError("$Can't open tempfile"); WriteError("$Can't open tempfile");
return; return;
} }
from = fido2faddr(msgs.Aka); from = fido2faddr(msgs.Aka);
sprintf(fromname, "%s", Msg.From); strncpy(fromname, Msg.From, 36);
for (i = 0; i < strlen(fromname); i++) for (i = 0; i < strlen(fromname); i++)
if (fromname[i] == ' ') if (fromname[i] == ' ')
fromname[i] = '_'; fromname[i] = '_';
@ -840,14 +835,23 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
if ((p = (char *)MsgText_First()) != NULL) { if ((p = (char *)MsgText_First()) != NULL) {
do { do {
if (strncmp(p, "To: ", 4) == 0) { if (strncmp(p, "To: ", 4) == 0) {
Syslog('m', "%s", MBSE_SS(p));
if ((strchr(p, '<') != NULL) && (strchr(p, '>') != NULL)) {
q = strtok(p, "<"); q = strtok(p, "<");
q = strtok(NULL, ">"); q = strtok(NULL, ">");
} else {
q = strtok(p, " ");
q = strtok(NULL, " \n\r\t");
}
sprintf(MailTo, "%s", q); sprintf(MailTo, "%s", q);
Syslog('m', "Final MailTo \"%s\"", MailTo);
break; break;
} }
} while ((p = (char *)MsgText_Next()) != NULL); } while ((p = (char *)MsgText_Next()) != NULL);
} }
} }
Syslog('+', "UUCP gate From: %s at %s To: %s", Msg.From, Msg.FromAddress, MailTo);
/* /*
* First send all headers * First send all headers
@ -862,11 +866,11 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
fprintf(fp, "X-Mailreader: MBSE BBS %s\r\n", VERSION); fprintf(fp, "X-Mailreader: MBSE BBS %s\r\n", VERSION);
if (msgs.Aka.point && !is_fmpt) if (msgs.Aka.point && !is_fmpt)
fprintf(fp, "X-FTN-FMPT: %d\r", msgs.Aka.point); fprintf(fp, "X-FTN-FMPT: %d\n", msgs.Aka.point);
if (Dest.point && !is_topt) if (Dest.point && !is_topt)
fprintf(fp, "X-FTN-TOPT: %d\r", Dest.point); fprintf(fp, "X-FTN-TOPT: %d\n", Dest.point);
if (!is_intl) if (!is_intl)
fprintf(fp, "X-FTN-INTL: %d:%d/%d %d:%d/%d\r", Dest.zone, Dest.net, Dest.node, fprintf(fp, "X-FTN-INTL: %d:%d/%d %d:%d/%d\n", Dest.zone, Dest.net, Dest.node,
msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node); msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node);
if (Msg_Read(MsgNum, 78)) { if (Msg_Read(MsgNum, 78)) {
@ -874,7 +878,7 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
do { do {
if (p[0] == '\001') { if (p[0] == '\001') {
if (strncmp(p, "\001INTL", 5) == 0) if (strncmp(p, "\001INTL", 5) == 0)
fprintf(fp, "X-FTN-INTL: %s\n", p+4); fprintf(fp, "X-FTN-INTL: %s\n", p+6);
else else
fprintf(fp, "X-FTN-%s\n", p+1); fprintf(fp, "X-FTN-%s\n", p+1);
} }

View File

@ -1217,34 +1217,37 @@ int ReadPanel()
void Reply_Msg(int IsReply) void Reply_Msg(int IsReply)
{ {
int i, j, x; int i, j, x;
char to[65]; char to[65], from[65], subj[73], msgid[81], replyto[81], replyaddr[81], *tmp, *buf, qin[6];
char from[65];
char subj[72];
char msgid[81];
char replyto[81];
char replyaddr[81];
char *tmp, *buf;
char qin[6];
faddr *Dest = NULL; faddr *Dest = NULL;
if (!Post_Allowed()) if (!Post_Allowed())
return; return;
sprintf(from, "%s", Msg.To); strncpy(from, Msg.To, 64);
sprintf(to, "%s", Msg.From); strncpy(to, Msg.From, 64);
sprintf(replyto, "%s", Msg.ReplyTo); strncpy(replyto, Msg.ReplyTo, 80);
sprintf(replyaddr, "%s", Msg.ReplyAddr);
/*
* For some reason there are sometimes spaces at the
* beginning of the reply address.
*/
tmp = Msg.ReplyAddr;
while (*tmp && isspace(*tmp))
tmp++;
strncpy(replyaddr, tmp, 80);
Dest = parsefnode(Msg.FromAddress); Dest = parsefnode(Msg.FromAddress);
Syslog('m', "Parsed from address %s", ascfnode(Dest, 0x1f)); Syslog('m', "Parsed from address %s", ascfnode(Dest, 0x1f));
if (strncasecmp(Msg.Subject, "Re:", 3) && strncasecmp(Msg.Subject, "Re^2:", 5) && IsReply) { if (strncasecmp(Msg.Subject, "Re:", 3) && strncasecmp(Msg.Subject, "Re^2:", 5) && IsReply) {
sprintf(subj, "Re: %s", Msg.Subject); sprintf(subj, "Re: ");
strncpy(subj+4, Msg.Subject, 68);
} else { } else {
sprintf(subj, "%s", Msg.Subject); strncpy(subj, Msg.Subject, 72);
} }
Syslog('m', "Reply msg to %s, subject %s", to, subj); Syslog('m', "Reply msg to %s, subject %s", to, subj);
Syslog('m', "Msgid was %s", Msg.Msgid); Syslog('m', "Msgid was %s", Msg.Msgid);
sprintf(msgid, "%s", Msg.Msgid); strncpy(msgid, Msg.Msgid, 80);
x = 0; x = 0;
WhosDoingWhat(READ_POST); WhosDoingWhat(READ_POST);
@ -1261,18 +1264,18 @@ void Reply_Msg(int IsReply)
Message[i] = (char *) calloc(81, sizeof(char)); Message[i] = (char *) calloc(81, sizeof(char));
Msg_New(); Msg_New();
sprintf(Msg.Replyid, "%s", msgid); strncpy(Msg.Replyid, msgid, 80);
sprintf(Msg.ReplyTo, "%s", replyto); strncpy(Msg.ReplyTo, replyto, 80);
sprintf(Msg.ReplyAddr, "%s", replyaddr); strncpy(Msg.ReplyAddr, replyaddr, 80);
/* From : */ /* From : */
sprintf(Msg.From, "%s", exitinfo.sUserName); strncpy(Msg.From, exitinfo.sUserName, 100);
pout(YELLOW, BLACK, (char *) Language(209)); pout(YELLOW, BLACK, (char *) Language(209));
pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.From); pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.From);
Enter(1); Enter(1);
/* To : */ /* To : */
sprintf(Msg.To, "%s", to); strncpy(Msg.To, to, 100);
pout(YELLOW, BLACK, (char *) Language(208)); pout(YELLOW, BLACK, (char *) Language(208));
pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.To); pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.To);
Enter(1); Enter(1);
@ -1282,7 +1285,7 @@ void Reply_Msg(int IsReply)
Enter(1); Enter(1);
/* Subject : */ /* Subject : */
pout(YELLOW, BLACK, (char *) Language(210)); pout(YELLOW, BLACK, (char *) Language(210));
sprintf(Msg.Subject, "%s", subj); strncpy(Msg.Subject, subj, 100);
pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.Subject); pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.Subject);
x = strlen(subj); x = strlen(subj);