Hashed domain directories - options

Eric Shubert <[email protected]> Wed, 08 Aug 2012 18:32:01 -0700
Newsgroups gmane.mail.vpopmail
Organization Eric Shubert & Associates
Message-ID <[email protected]>
Hey Matt,

A QMT user recently had a few problems with their dir_control values 
(mysql), which got me to thinking about the directory hashing.

QMT uses the --disable-users-big-dir configure option, so user 
directories are never hashed. (BTW, this option also appears to allow 
single-digit user names, which I haven't seen documented anywhere except 
in the change log). So hashed user directories don't exist in QMT. I was 
thinking that it'd be nice to have a --disable-domains-big-dir option as 
well, which would keep domains from being hashed. From the looks of the 
code involved with --disable-users-big-dir, I'm guessing that it 
wouldn't take much to code the option for domains.

Then I thought a little more about it. What if the
#define MAX_USERS_PER_LEVEL 100
value that's in the vauth.h file was a field in the dir_control record? 
That would allow admins to control the behavior of hashing, setting it 
according to their particular environment, without needing to rebuild 
with a different config option. There'd be no additional i/o involved, 
because the dir_control record is already fetched. In an ext3 
environment, it could be set (by the admin) to 30000 (ext3 supports 
32000 subdirectories), and with ext4 it could be set to 60000 (ext4 
supports 64000). These settings would for the most part disable hashed 
directories, while still allowing hashes should the filesystem limits be 
approached. Of course, a default value in dir_control could still be 
100, which would maintain former behavior. If this were done, the 
--disable-users-big-dir option should probably be changed to 
--allow-single-digit-users as well. ;)

Please let me know what the prospects of such changes are. If it doesn't 
look like anything that might ever happen in this area, I just may patch 
the vauth.h file to be 30000 and call it done.

Thanks for your consideration.

-- 
-Eric 'shubes'



!DSPAM:5023131e34211160355790!