diff -u -r -x '*.o' mutt-1.5.17/bcache.c mutt-1.5.17-hacked/bcache.c
--- mutt-1.5.17/bcache.c	2007-04-13 06:44:40.000000000 +1000
+++ mutt-1.5.17-hacked/bcache.c	2008-03-16 23:03:50.001121700 +1100
@@ -71,6 +71,8 @@
   if (len < 0 || len >= dstlen-1)
     return -1;
 
+  mutt_sanitize_filename(dst, 0);
+
   dprint (3, (debugfile, "bcache_path: directory: '%s'\n", dst));
 
   return 0;
diff -u -r -x '*.o' mutt-1.5.17/hcache.c mutt-1.5.17-hacked/hcache.c
--- mutt-1.5.17/hcache.c	2007-09-18 07:24:22.000000000 +1000
+++ mutt-1.5.17-hacked/hcache.c	2008-03-16 22:15:38.886856700 +1100
@@ -508,6 +508,10 @@
   if (ret <= 0)
     return path;
 
+  mutt_sanitize_filename(hcpath, 0);
+
+  dprint (3, (debugfile, "mutt_hcache_per_folder: hcpath: '%s'\n", hcpath));
+
   if (stat (hcpath, &sb) >= 0)
     return hcpath;
 
diff -u -r -x '*.o' mutt-1.5.17/lib.c mutt-1.5.17-hacked/lib.c
--- mutt-1.5.17/lib.c	2007-11-01 08:06:11.000000000 +1100
+++ mutt-1.5.17-hacked/lib.c	2008-03-16 22:20:56.877398700 +1100
@@ -630,7 +630,7 @@
     return (fopen (path, mode));
 }
 
-static char safe_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+@{}._-:%/";
+static char safe_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+@{}._-%/";
 
 void mutt_sanitize_filename (char *f, short slash)
 {
