I noticed that some people have asked about hashed spool directories in 
the past.  This means the spool is /var/mail/s/e/selsky instead of 
/var/mail/selsky

The attached patch against imap-2002e implements hashed spool
directories (which are disabled by default).  If there are any changes 
which would help this get accepted into the main distribution, please 
let me know.

Cheers.
--- src/osdep/unix/env_unix.c   2003/10/04 03:51:51     1.2
+++ src/osdep/unix/env_unix.c   2004/01/06 05:25:52
@@ -92,6 +92,8 @@
                                /* block notification */
 static blocknotify_t mailblocknotify = mm_blocknotify;
 
+static short spool_hash_depth = 0; /* 2 means spool is /var/mail/f/o/foo */
+
 /* Note: setting disableLockWarning means that you assert that the
  * so-modified copy of this software will NEVER be used:
  *  1) in conjunction with any software which expects .lock files
@@ -820,7 +822,23 @@
 {
   char tmp[MAILTMPLEN];
   if (!sysInbox) {             /* initialize if first time */
-    sprintf (tmp,"%s/%s",MAILSPOOL,myusername ());
+    int i;
+    char c;
+
+    sprintf (tmp,"%s/",MAILSPOOL);
+
+    for (i = 0; i < spool_hash_depth; i++)
+    {
+      /* deal with usernames shorter than hash depth */
+      if (strlen (myusername ()) > i)
+      {
+        c = myusername ()[i];
+      }
+      sprintf (tmp+strlen (tmp),"%c/", c);
+    }
+
+    strcat (tmp,myusername ());
+
     sysInbox = cpystr (tmp);   /* system inbox is from mail spool */
   }
   return sysInbox;

Reply via email to