On Wed, Feb 02, 2005 at 04:40:26PM -0800, Sean Plaice wrote:
> 
> example: 
> uid: [EMAIL PROTECTED]
> maildirId: 653033
> homeDirectory: /nfs/mailstore/3/3/0/... etc.
> 
> This has a lot of drawbacks because of the need to track the
> maildirId, and manage the increment of it. Does anyone else have any
> other methods they use, and would share?

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.

Chris

Reply via email to