This patch fixes 2 problems:

1) A file's time stamp is not set to current time when the file is modified

2) Execute-permission for other is not cleared when a file is modified

For: Mutt 1.4i
(Which happens to be the one shipped with SuSE 8.1.)

Volker Kuhlmann
12 Jan 2002, Aug 2002, 16 Nov 2002



--- mutt-1.4/mbox.c.orig	2002-11-16 18:47:10.000000000 +1300
+++ mutt-1.4/mbox.c	2002-11-16 18:47:50.000000000 +1300
@@ -684,7 +684,7 @@
   int first = -1;	/* first message to be written */
   long offset;	/* location in mailbox to write changed messages */
   struct stat statbuf;
-  struct utimbuf utimebuf;
+/*  struct utimbuf utimebuf;*/
   struct m_update_t *newOffset = NULL;
   struct m_update_t *oldOffset = NULL;
   FILE *fp = NULL;
@@ -969,10 +969,20 @@
   }
 
   /* Restore the previous access/modification times */
+/*
   utimebuf.actime = statbuf.st_atime;
   utimebuf.modtime = statbuf.st_mtime;
   utime (ctx->path, &utimebuf);
+*/
 
+  /* Clear the executable bit for other. This is very convenient for use with
+   * procmail which can be set up to indicate new mail by setting the o+x flag.
+   */
+  if (stat (ctx->path, &statbuf) == 0) {
+	chmod (ctx->path, statbuf.st_mode & (~S_IXOTH));
+	/* No need to check return code of chmod(), if it fails we ignore it */
+  }
+  
   /* reopen the mailbox in read-only mode */
   if ((ctx->fp = fopen (ctx->path, "r")) == NULL)
   {

