Javier de Miguel Rodríguez
2010-Jun-11 06:16 UTC
[Dovecot] Question about directory hashing
Hello I have been reading http://wiki.dovecot.org/MailLocation and http://wiki.dovecot.org/Variables and I do not fully understand the directory hashing feature. I want to migrate > 70.000 users from Sun Messaging to Dovecot using imapsync. I have tested with mail_location=maildir:/buzones/us.es/%1Hu/%2.1u/%n but I get the following directory tree: `-- 0 |-- - |-- 1 |-- 2 |-- 3 |-- 8 |-- _ |-- a |-- ab |-- b |-- c |-- d |-- e |-- ev |-- f |-- g |-- h |-- i |-- ie |-- is |-- j |-- jb |-- jj |-- jp |-- js |-- k |-- l |-- m |-- mb |-- n |-- o |-- p |-- pp |-- q |-- r |-- rm |-- s |-- t |-- u |-- v |-- w |-- x |-- y `-- z The ideal directory layout should be the following: First directory level: Letters from a to z Second directory level: Numbers from 0 to 200 Third directory level: %n (username without @domain) How can I achive this directory layout (or other optimized for 70.000 users) . I use ext3 on Red Hat Enterprise Linux 5 with directory indexes on. Regards Javier de Miguel
On pe, 2010-06-11 at 08:16 +0200, Javier de Miguel Rodr??guez wrote:> mail_location=maildir:/buzones/us.es/%1Hu/%2.1u/%n but I get the > following directory tree: > > `-- 0 > |-- - > |-- 1 > |-- 2.. Numbers with %H work in a special way (actually I had completely forgotten about this): %H - take a 32bit hash of the variable and return it as hex. You can also limit the hash value. For example %256Hu gives values 0..ff. You might want padding also, so %2.256Hu gives 00..ff. This can be useful for example in dividing users automatically to multiple partitions.> The ideal directory layout should be the following: > > First directory level: Letters from a to z > Second directory level: Numbers from 0 to 200 > Third directory level: %n (username without @domain)That's not possible, but you could have the same number of directories with: %2.26Hn/%2.200Hn/%n