Serveral fixes and updates

This commit is contained in:
Michiel Broek
2003-01-11 12:14:04 +00:00
parent 27ae851cf5
commit e63a3b2bf5
4 changed files with 64 additions and 49 deletions

View File

@@ -82,9 +82,9 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
time_t now;
struct tm *tm;
Syslog('M', "Post netmail from: %s", ascfnode(f, 0xff));
Syslog('M', "Post netmail to : %s", ascfnode(t, 0xff));
Syslog('M', "Post netmail subj: %s", MBSE_SS(subject));
Syslog('m', "Post netmail from: %s", ascfnode(f, 0xff));
Syslog('m', "Post netmail to : %s", ascfnode(t, 0xff));
Syslog('m', "Post netmail subj: %s", MBSE_SS(subject));
net_in++;
/*
@@ -107,6 +107,22 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
Syslog('m', "Setting pointinfo (%d) from MSGID", ta->point);
fmpt = f->point = ta->point;
}
if ((ta->net == f->net) && (ta->node == f->node) && (f->zone == 0)) {
/*
* Missing zone info, maybe later we will see a INTL kludge or so, but for
* now, just in case we fix it. And we need that for some Aka collecting
* sysop who doesn't know how to configure his system right.
*/
Syslog('m', "No from zone set, setting zone %d from MSGID", ta->zone);
f->zone = ta->zone;
/*
* 99.9 % chance that the destination zone is also missing.
*/
if (t->zone == 0) {
t->zone = ta->zone;
Syslog('m', "No dest zone set, setting zone %d from MSGID", ta->zone);
}
}
tidy_faddr(ta);
}
}

View File

@@ -164,10 +164,12 @@ int Tic()
*/
int LoadTic(char *inb, char *tfn)
{
FILE *tfp;
char *Temp, *Temp2, *Buf, *Log = NULL, RealName[256];
int i, j, rc, bufsize, DescCnt = FALSE;
fa_list *sbl = NULL;
FILE *tfp;
char *Temp, *Temp2, *Buf, *Log = NULL, RealName[256];
int i, j, rc, bufsize, DescCnt = FALSE;
fa_list *sbl = NULL;
DIR *dp;
struct dirent *de;
if (CFG.slow_util && do_quiet)
usleep(1);
@@ -425,47 +427,27 @@ int LoadTic(char *inb, char *tfn)
* Find out what the real name of the file is,
* most likely this is a 8.3 filename.
*/
sprintf(Temp2, "%s", TIC.TicIn.File);
sprintf(Temp, "%s/%s", TIC.Inbound, Temp2);
if (file_exist(Temp, R_OK) == 0) {
strcpy(RealName, Temp2);
} else {
tu(Temp2);
sprintf(Temp, "%s/%s", TIC.Inbound, Temp2);
if (file_exist(Temp, R_OK) == 0) {
strcpy(RealName, Temp2);
} else {
tl(Temp2);
sprintf(Temp, "%s/%s", TIC.Inbound, Temp2);
if (file_exist(Temp, R_OK) == 0) {
strcpy(RealName, Temp2);
}
}
}
/*
* If the above didn't find the file and we got a LFN
* the search again.
*/
if (strlen(TIC.TicIn.FullName) && (strlen(RealName) == 0)) {
sprintf(Temp2, "%s", TIC.TicIn.FullName);
sprintf(Temp, "%s/%s", TIC.Inbound, Temp2);
if (file_exist(Temp, R_OK) == 0) {
strcpy(RealName, Temp2);
} else {
tu(Temp2);
sprintf(Temp, "%s/%s", TIC.Inbound, Temp2);
if (file_exist(Temp, R_OK) == 0) {
strcpy(RealName, Temp2);
} else {
tl(Temp2);
sprintf(Temp, "%s/%s", TIC.Inbound, Temp2);
if (file_exist(Temp, R_OK) == 0) {
strcpy(RealName, Temp2);
}
}
if ((dp = opendir(TIC.Inbound)) == NULL) {
WriteError("$Can't opendir(%s)", TIC.Inbound);
return 1;
}
while ((de = readdir(dp))) {
/*
* Check 8.3 FN
*/
if (strcasecmp(de->d_name, TIC.TicIn.File) == 0) {
strncpy(RealName, de->d_name, 255);
break;
}
/*
* Check LFN
*/
if (strcasecmp(de->d_name, TIC.TicIn.FullName) == 0) {
strncpy(RealName, de->d_name, 255);
break;
}
}
closedir(dp);
}
if (strlen(RealName) == 0) {
@@ -476,6 +458,14 @@ int LoadTic(char *inb, char *tfn)
TIC.Orphaned = TRUE;
WriteError("Can't find file in inbound");
} else {
/*
* If no LFN received in the ticfile and the file in the inbound is the same as the 8.3 name
* but only the case is different, then treat the real filename as LFN.
*/
if ((strlen(TIC.TicIn.FullName) == 0) && strcmp(TIC.TicIn.File, RealName) && (strcasecmp(TIC.TicIn.File, RealName) == 0)) {
Syslog('f', "Real filename possible LFN, faking it");
strcpy(TIC.TicIn.FullName, RealName);
}
Syslog('f', "Real filename in inbound is \"%s\"", RealName);
Syslog('+', "8.3 name \"%s\", LFN \"%s\"", TIC.TicIn.File, TIC.TicIn.FullName);
if (strcmp(RealName, TIC.TicIn.File)) {