Maximum amount of mailboxes

Andrew Morgan morgan at
Tue May 15 15:43:25 EDT 2007

On Tue, 15 May 2007, ledouxe wrote:

> Hi,
> A client of mine has come upon what seems to be the limit of mailboxes for 
> one letter. They use student numbers for mailbox names. When a mailbox is 
> numerical, Cyrus puts the mailboxes under the letter "q" in /var/spool/imap 
> (ex: /var/spool/imap/q/user/12345/ )
> My client can't create any more mailboxes (he has around 40 000). If he 
> deletes one, he can create one but can't create any more. But he can create a 
> new mailbox named "foo" for example. Just no more numerical mailboxes.
> Has he reached Cyrus' maximum for one letter? Am I looking in the right 
> place?

More likely you've reached a limit in the number of entries you can have 
in a single directory - a filesystem limitation.

The basic hashing method for Cyrus directories places all numerical 
usernames in 'q' (as you found out).  You might look into the fulldirhash 
method instead.  I'm not good enough with my perl to understand what this 
code actually does:

         $n = 0;
         foreach my $b (split(/ */, $name)) {
             $n = (($n << 3) ^ ($n >> 5)) ^ ord($b);
         $h = chr(ord('A') + ($n % 23));
         return $h;

but that is the method it uses for fulldirhash.  :)  It *will* spread the 
numeric usernames around.

Make sure you read the docs on converting from basic to full hashing, 
since it requires some offline time for Cyrus.


More information about the Info-cyrus mailing list