Hi, I'm running mutt on a system that uses Novell NetWare for the
home directories, and last week the local admins reconfigured it
in such a way that it no longer supports colons (:) in filenames,
which breaks maildir.

Below is a patch that allows mutt to be compiled to use the
non-standard semicolon (;) character instead of a colon.  This
breaks the maildir standard, but it works on filesystems that
lack colon support.

The patch takes effect if MAILDIR_ON_BROKEN_FILESYSTEM is defined.
To compile a patched version of mutt 1.5.21 in your home directory, do:

tar -zxvf mutt-1.5.21.tar.gz
patch -p0 < maildir-semicolon-patch
cd mutt-1.5.21
export CFLAGS=-DMAILDIR_ON_BROKEN_FILESYSTEM
./configure --prefix="$(HOME)/mutt" && make && make install

Posting it here in case it's useful for anyone else.

Silas

--------------------- cut here -------------------------
diff -ur mutt-1.5.21-orig/mh.c mutt-1.5.21/mh.c
--- mutt-1.5.21-orig/mh.c       2011-09-19 10:58:14.612281056 +0100
+++ mutt-1.5.21/mh.c    2011-09-19 11:41:14.757075287 +0100
@@ -531,6 +531,12 @@
 
 /* maildir support */
 
+#ifdef MAILDIR_ON_BROKEN_FILESYSTEM
+#define MAILDIR_SEP_CHAR ';' /* Windows compatible but non-standard */
+#else
+#define MAILDIR_SEP_CHAR ':' /* the standard */
+#endif
+
 static void maildir_free_entry (struct maildir **md)
 {
   if (!md || !*md)
@@ -565,7 +571,7 @@
   h->read = 0;
   h->replied = 0;
 
-  if ((p = strrchr (path, ':')) != NULL && mutt_strncmp (p + 1, "2,", 2) == 0)
+  if ((p = strrchr (path, MAILDIR_SEP_CHAR)) != NULL && mutt_strncmp (p + 1, 
"2,", 2) == 0)
   {
     p += 3;
     
@@ -814,7 +820,7 @@
 #if USE_HCACHE
 static size_t maildir_hcache_keylen (const char *fn)
 {
-  const char * p = strrchr (fn, ':');
+  const char * p = strrchr (fn, MAILDIR_SEP_CHAR);
   return p ? (size_t) (p - fn) : mutt_strlen(fn);
 }
 #endif
@@ -1219,7 +1225,7 @@
              NONULL(hdr->maildir_flags));
     if (hdr->maildir_flags)
       qsort (tmp, strlen (tmp), 1, ch_compar);
-    snprintf (dest, destlen, ":2,%s", tmp);
+    snprintf (dest, destlen, "%c2,%s", MAILDIR_SEP_CHAR, tmp);
   }
 }
 
@@ -1338,7 +1344,7 @@
   strfcpy (subdir, s, 4);
 
   /* extract the flags */
-  if ((s = strchr (s, ':')))
+  if ((s = strchr (s, MAILDIR_SEP_CHAR)))
     strfcpy (suffix, s, sizeof (suffix));
   else
     suffix[0] = '\0';
@@ -1601,7 +1607,7 @@
     strfcpy (newpath, p, sizeof (newpath));
 
     /* kill the previous flags */
-    if ((p = strchr (newpath, ':')) != NULL)
+    if ((p = strchr (newpath, MAILDIR_SEP_CHAR)) != NULL)
       *p = 0;
 
     maildir_flags (suffix, sizeof (suffix), h);
@@ -1764,7 +1770,7 @@
     src = t + 1;
 
   strfcpy (dest, src, l);
-  if ((u = strrchr (dest, ':')))
+  if ((u = strrchr (dest, MAILDIR_SEP_CHAR)))
     *u = '\0';
 
   return dest;
--------------------- cut here -------------------------

-- 
Silas S Brown http://people.pwf.cam.ac.uk/ssb22

Reply via email to