changeset 707:029973432cf4

Fixed bug in mlmmj-maintd which caused loss of archive files in some requeue cases (Robin H. Johnson)
author mortenp
date Mon, 21 Dec 2009 17:32:00 +1100
parents 52189a450b0c
children 02bb549a833c
files ChangeLog src/mlmmj-maintd.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Dec 21 17:22:58 2009 +1100
+++ b/ChangeLog	Mon Dec 21 17:32:00 2009 +1100
@@ -1,3 +1,5 @@
+ o Fixed bug in mlmmj-maintd which caused loss of archive files in some
+   requeue cases (Robin H. Johnson)
  o Added README.postfix (Jeremy Hinegardner, Andreas Schneider)
  o Added support for digest and nomail to +list (Christoph Wilke)
  o Caseinsensitive string compare for owner addr when +list is invoked. Spotted
--- a/src/mlmmj-maintd.c	Mon Dec 21 17:22:58 2009 +1100
+++ b/src/mlmmj-maintd.c	Mon Dec 21 17:32:00 2009 +1100
@@ -373,7 +373,7 @@
 	struct stat st;
 	pid_t childpid, pid;
 	time_t t;
-	int status, fromrequeuedir = 0;
+	int status, fromrequeuedir;
 
 	if(chdir(dirname) < 0) {
 		log_error(LOG_ARGS, "Could not chdir(%s)", dirname);
@@ -408,6 +408,10 @@
 
 		archivefilename = concatstr(3, listdir, "/archive/",
 						dp->d_name);
+
+		/* Explicitly initialize for each mail we examine */
+		fromrequeuedir = 0;
+
 		if(stat(archivefilename, &st) < 0) {
 			/* Might be it's just not moved to the archive
 			 * yet because it's still getting sent, so just