On Wed, 2 Feb 2005 17:18:19 -0800, Chris Wilkes
<[EMAIL PROTECTED]> wrote:
> Hrm, you could pass this decision down to your autodirmake program by
> setting the initial homeDirectory to something like
>    /tmp/maildirs/20050202-13111441
> where the last part is a random number so that its near impossible to
> have a directory by that name.  So when email is first delivered to this
> user your autodirmake program runs and it does the search for a new id
> to give this user.
> 
> That program could have something simple like checking for the existance
> of a lock file and pausing to run until that lock file is deleted.  Then
> it reads from ~/.lastid to see the last id and then tries to see if the
> next one is available as a directory, if not the next, etc.
> 
> Last part of the script will then update your LDAP entry's maildirId
> and homeDirectory attributes.
> 
> Just watch out if you have two different qmail-ldap servers writing to
> to two different disks -- users would then be likely to share
> maildirIds.  I suppose if you have your maildirectory root set to
> something like
>   /var/qmail/maildirs/`hostname`
> you can get around that problem.

That is along the lines of what I had brewing in my head, you summed
it up perfectly though.

One extra step that might be fruitful would be to track the empty
maildirId's that accrue over time as people remove mailboxes, and have
the autodirmaker recycle the unused ones. This would slow the growth
of the hash and ensure that the hash is balanced, and hole free.

-- 
Sean

Reply via email to