Better checking for empty *.msg netmails
This commit is contained in:
parent
be82b565ac
commit
7d2e269c05
@ -12,6 +12,13 @@ v0.71.2 16-Jan-2005
|
||||
data frames, this will case uncompress error -5 because zero
|
||||
bytes can't be compressed ar all.
|
||||
|
||||
mbfido:
|
||||
Empty *.msg netmails for our own system are dropped with and
|
||||
logged (just like received empty netmails). Empty netmails to
|
||||
remote systems are still stored in the netmail base.
|
||||
Added debug logging for exporting netmails from the messagebase
|
||||
so that we later can decide to mark these messages auto deleted.
|
||||
|
||||
mbnntp:
|
||||
Does now send the right mime headers recognised by new clients.
|
||||
Fixed compile problem with some compilers.
|
||||
|
18
mbfido/msg.c
18
mbfido/msg.c
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Read *.msg messages
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2004
|
||||
* Copyright (C) 1997-2005
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -92,10 +92,11 @@ int toss_msgs(void)
|
||||
* 3 = Missing zone info
|
||||
* 4 = No ftn network or netmailboard in setup
|
||||
* 5 = Can't open JAM area
|
||||
* 6 = Empty local netmail, dropped.
|
||||
*/
|
||||
int toss_onemsg(char *msgname)
|
||||
{
|
||||
int rc = 0, islocal;
|
||||
int rc = 0, islocal, empty = TRUE;
|
||||
char *temp, *dospath, *flagstr = NULL, *l, *r, *msgid = NULL;
|
||||
char fromUserName[36], toUserName[36], subject[72], DateTime[20];
|
||||
FILE *fp, *np;
|
||||
@ -230,7 +231,12 @@ int toss_onemsg(char *msgname)
|
||||
flagstr = xstrcpy(buf + 8);
|
||||
Syslog('m', "^aFLAGS: %s", flagstr);
|
||||
}
|
||||
if (buf[0] != '\0') {
|
||||
if ((buf[0] != '\001') && (strcmp(buf, (char *)"--- ")))
|
||||
empty = FALSE;
|
||||
}
|
||||
}
|
||||
Syslog('m', "Mail is %sempty", empty ? "":"not ");
|
||||
|
||||
Syslog('m', "From %d:%d/%d.%d to %d:%d/%d.%d", origZone, origNet, origNode, origPoint, destZone, destNet, destNode, destPoint);
|
||||
|
||||
@ -291,6 +297,14 @@ int toss_onemsg(char *msgname)
|
||||
/*
|
||||
* Message is local, make the message appear as a received netmail
|
||||
*/
|
||||
if (empty) {
|
||||
Syslog('+', "Empty local netmail for %s dropped", toUserName);
|
||||
Msg_UnLock();
|
||||
Msg_Close();
|
||||
fclose(fp);
|
||||
free(temp);
|
||||
return 6;
|
||||
}
|
||||
islocal = TRUE;
|
||||
if ((strncasecmp(toUserName, "sysop", 5) == 0) ||
|
||||
(strncasecmp(toUserName, "postmaster", 10) == 0) ||
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose ...............: Scan for outgoing mail.
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2004
|
||||
* Copyright (C) 1997-2005
|
||||
*
|
||||
* Michiel Broek FIDO: 2:280/2802
|
||||
* Beekmansbos 10
|
||||
@ -116,8 +116,7 @@ void ScanMail(int DoAll)
|
||||
}
|
||||
|
||||
if ((i != scanned) || (i == 0)) {
|
||||
Syslog('+', "Not all messages exported, forcing full mail scan");
|
||||
Syslog('+', "i=%d scanned=%d", i, scanned);
|
||||
Syslog('+', "Not all messages exported, forcing full mail scan to fix this");
|
||||
DoFull = TRUE;
|
||||
}
|
||||
free(Fname);
|
||||
@ -775,7 +774,7 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl)
|
||||
void ExportNet(unsigned long MsgNum, int UUCPgate)
|
||||
{
|
||||
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, mypoint = FALSE;
|
||||
int i, rc, flags = 0, first, is_fmpt = FALSE, is_topt = FALSE, is_intl = FALSE, mypoint = FALSE, empty = TRUE;
|
||||
FILE *qp, *fp, *fl;
|
||||
fidoaddr Dest, Route, *dest;
|
||||
time_t now;
|
||||
@ -802,9 +801,13 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
|
||||
is_intl = TRUE;
|
||||
if (strncmp(p, "--- ", 4) == 0)
|
||||
break;
|
||||
if ((p[0] != '\001') && (p[0] != '\0')) {
|
||||
empty = FALSE;
|
||||
}
|
||||
} while ((p = (char *)MsgText_Next()) != NULL);
|
||||
}
|
||||
}
|
||||
Syslog('m', " netmail is %sempt", empty ? "":"not ");
|
||||
|
||||
/*
|
||||
* Check if this a netmail to our own local UUCP gate.
|
||||
|
Reference in New Issue
Block a user