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.
When a new tic area was created the first file received for
that area was refused.
Fixed a few problems with local UUCP created netmails.
newuser:
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.
When a user paged the sysop for a chat, after the timer was
expired, the bbs crashed.
Fixed a problem with extra spaces in UUCP replyto address.
mbtask:
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)
{
char *p, *q, ext[4], fromname[37];
int i, rc, flags = 0, first;
char *p, *q, ext[4], fromname[37], flavor, MailFrom[128], MailTo[128];
int i, rc, flags = 0, first, is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE;
FILE *qp, *fp;
fidoaddr Dest, Route, *dest;
time_t now;
struct tm *tm;
char flavor;
faddr *from, *too, *ta;
int is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE;
unsigned short point;
char MailFrom[128], MailTo[128];
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");
@ -823,14 +820,12 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
if ((!strcmp(Msg.To, "UUCP")) && (is_local(ta))) {
tidy_faddr(ta);
most_debug = TRUE;
Syslog('m', "We are the UUCP gate");
Syslog('m', "From %s FromAddress %s", Msg.From, Msg.FromAddress);
if ((fp = tmpfile()) == NULL) {
WriteError("$Can't open tempfile");
return;
}
from = fido2faddr(msgs.Aka);
sprintf(fromname, "%s", Msg.From);
strncpy(fromname, Msg.From, 36);
for (i = 0; i < strlen(fromname); i++)
if (fromname[i] == ' ')
fromname[i] = '_';
@ -840,14 +835,23 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
if ((p = (char *)MsgText_First()) != NULL) {
do {
if (strncmp(p, "To: ", 4) == 0) {
Syslog('m', "%s", MBSE_SS(p));
if ((strchr(p, '<') != NULL) && (strchr(p, '>') != NULL)) {
q = strtok(p, "<");
q = strtok(NULL, ">");
} else {
q = strtok(p, " ");
q = strtok(NULL, " \n\r\t");
}
sprintf(MailTo, "%s", q);
Syslog('m', "Final MailTo \"%s\"", MailTo);
break;
}
} while ((p = (char *)MsgText_Next()) != NULL);
}
}
Syslog('+', "UUCP gate From: %s at %s To: %s", Msg.From, Msg.FromAddress, MailTo);
/*
* 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);
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)
fprintf(fp, "X-FTN-TOPT: %d\r", Dest.point);
fprintf(fp, "X-FTN-TOPT: %d\n", Dest.point);
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);
if (Msg_Read(MsgNum, 78)) {
@ -874,7 +878,7 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
do {
if (p[0] == '\001') {
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
fprintf(fp, "X-FTN-%s\n", p+1);
}

View File

@ -1217,34 +1217,37 @@ int ReadPanel()
void Reply_Msg(int IsReply)
{
int i, j, x;
char to[65];
char from[65];
char subj[72];
char msgid[81];
char replyto[81];
char replyaddr[81];
char *tmp, *buf;
char qin[6];
char to[65], from[65], subj[73], msgid[81], replyto[81], replyaddr[81], *tmp, *buf, qin[6];
faddr *Dest = NULL;
if (!Post_Allowed())
return;
sprintf(from, "%s", Msg.To);
sprintf(to, "%s", Msg.From);
sprintf(replyto, "%s", Msg.ReplyTo);
sprintf(replyaddr, "%s", Msg.ReplyAddr);
strncpy(from, Msg.To, 64);
strncpy(to, Msg.From, 64);
strncpy(replyto, Msg.ReplyTo, 80);
/*
* 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);
Syslog('m', "Parsed from address %s", ascfnode(Dest, 0x1f));
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 {
sprintf(subj, "%s", Msg.Subject);
strncpy(subj, Msg.Subject, 72);
}
Syslog('m', "Reply msg to %s, subject %s", to, subj);
Syslog('m', "Msgid was %s", Msg.Msgid);
sprintf(msgid, "%s", Msg.Msgid);
strncpy(msgid, Msg.Msgid, 80);
x = 0;
WhosDoingWhat(READ_POST);
@ -1261,18 +1264,18 @@ void Reply_Msg(int IsReply)
Message[i] = (char *) calloc(81, sizeof(char));
Msg_New();
sprintf(Msg.Replyid, "%s", msgid);
sprintf(Msg.ReplyTo, "%s", replyto);
sprintf(Msg.ReplyAddr, "%s", replyaddr);
strncpy(Msg.Replyid, msgid, 80);
strncpy(Msg.ReplyTo, replyto, 80);
strncpy(Msg.ReplyAddr, replyaddr, 80);
/* From : */
sprintf(Msg.From, "%s", exitinfo.sUserName);
strncpy(Msg.From, exitinfo.sUserName, 100);
pout(YELLOW, BLACK, (char *) Language(209));
pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.From);
Enter(1);
/* To : */
sprintf(Msg.To, "%s", to);
strncpy(Msg.To, to, 100);
pout(YELLOW, BLACK, (char *) Language(208));
pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.To);
Enter(1);
@ -1282,7 +1285,7 @@ void Reply_Msg(int IsReply)
Enter(1);
/* Subject : */
pout(YELLOW, BLACK, (char *) Language(210));
sprintf(Msg.Subject, "%s", subj);
strncpy(Msg.Subject, subj, 100);
pout(CFG.MsgInputColourF, CFG.MsgInputColourB, Msg.Subject);
x = strlen(subj);