From b314568630a539a7ef9d03316f751767656e9f20 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 11 Nov 2002 12:56:19 +0000 Subject: [PATCH] Updates for directory tossing --- ChangeLog | 2 ++ mbfido/dirsession.c | 11 ++++++++++- mbfido/dirsession.h | 2 +- mbfido/mbfido.c | 23 ++++++++++++++++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc354da5..e9c293d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -75,6 +75,8 @@ v0.35.05 19-Oct-2002 If filenames were exhausted and the last one (ending on z) is truncated in the outbound (has been sent already) it is erased before the archiver is called to reuse that filename again. + When mail/files were moved to the inbound from a directory + node, this was not processed in the same session. mbtask: Removed debug logging of "does" info. diff --git a/mbfido/dirsession.c b/mbfido/dirsession.c index 06367c1c..c7e6689d 100644 --- a/mbfido/dirsession.c +++ b/mbfido/dirsession.c @@ -140,13 +140,18 @@ void remlock(char *lockfile, int create, int loglvl) -void dirinbound(void) +/* + * Process directory inbound. Return TRUE if something is moved + * to the inbound for processing. + */ +int dirinbound(void) { FILE *fp; char *temp, *from, *too; long fileptr; struct dirent *de; DIR *dp; + int Something = FALSE; Syslog('m', "Starting directory inbound sessions"); @@ -188,6 +193,9 @@ void dirinbound(void) Syslog('m', "Move %s to %s", from, too); if (file_mv(from, too)) { WriteError("$Move %s to %s failed", from, too); + } else { + Something = TRUE; + Syslog('+', "Moved \"%s\" to %s", de->d_name, do_unprot ? CFG.inbound : CFG.pinbound); } } } @@ -211,6 +219,7 @@ void dirinbound(void) } free(temp); Syslog('m', "Finished directory inbound sessions"); + return Something; } diff --git a/mbfido/dirsession.h b/mbfido/dirsession.h index 27b827e0..57442805 100644 --- a/mbfido/dirsession.h +++ b/mbfido/dirsession.h @@ -7,6 +7,6 @@ int islocked(char *, int, int, int); /* Is directory locked */ int setlock(char *, int, int); /* Lock directory */ void remlock(char *, int, int); /* Unlock directory */ -void dirinbound(void); /* Process nodes */ +int dirinbound(void); /* Process nodes */ #endif diff --git a/mbfido/mbfido.c b/mbfido/mbfido.c index 64b96b15..72b2347d 100644 --- a/mbfido/mbfido.c +++ b/mbfido/mbfido.c @@ -566,7 +566,28 @@ int main(int argc, char **argv) /* * Do inbound direcory sessions */ - dirinbound(); + if (dirinbound()) { + if (do_tic) { + /* + * Hatch new files and process .tic files + * until nothing left to do. + */ + Loop = TRUE; + do { + Hatch(); + switch (Tic()) { + case -1: die(MBERR_OK); + break; + case 0: Loop = FALSE; + break; + default: break; + } + } while (Loop); + } + if (do_toss) { + TossMail(); + } + } } if (!do_uucp) newspost();