[Dovecot] Newbie questions: Load-balanced Dovecot with NFS storage

Mike Brudenell pmb1 at york.ac.uk
Wed Mar 7 14:15:19 EET 2007


Greetings -

I've got Dovecot 1.0rc24 up and running with both Maildirs and index  
files in the same user directory on NFS-mounted filestore.  Now I'm  
slowly edging things into a better, more efficient and NFS-friendly  
setup...

Currently I'm trying to move the index and control files off the NFS- 
mounted quota'd filestore and onto local disk without quotas.

Q1.  We are going to be running multiple load-balanced servers.  I know
      I can safely put the index files onto locally attached disk and  
they
      are rebuilt as and when needed.

      But is the same true for control files?  Or do they need to be
      preserved and made available to any server the user may come in
      through?  (This would imply having to have a different NFS-mounted
      filestore, as the NFS-mounted mailstore will have filestore quotas
      enabled, and I understand control files can be unhappy in this
      environment when the user runs out of quota.)


To break up large directories I want to create these in the form
     /var/dovecot/X/username/control
     /var/dovecot/X/username/index
where X is the first letter of the username.  So in dovecot.conf I have:

mail_location = maildir:/mailstore/%1u/%u/Maildir:INDEX=/var/dovecot/% 
1u/%u/index:CONTROL=/var/dovecot/%1u/%u/control

Q2.  An alternative would be to arrange the index and control diretories
      so they both hang off a single per-user area:
          /var/dovecot/X/username/control
          /var/dovecot/X/username/index
      However this again assumes I can safely delete files in the  
control
      directory tree if they aren't touched for a while.  Is this true,
      or are they 'valuable' and should be preserved for the lifetime of
      the account?

      (This is in part Q1 but phrased differently, I guess. :-)


I also hit some ownership/protection problems.  I'd originally  
assumed that I just had to create the top level
     /var/dovecot/{control,index}
directories and these could be owned root:root with mode 755.  But  
Dovecot fails to create these and logs entries such as:

     dovecot: Mar 07 12:00:47 Error: IMAP(pmb1)[2835]:
         mkdir(/var/dovecot/index/p/pmb1/.INBOX) failed: Permission  
denied

Experimentation suggests that the instance of Dovecot wanting to  
create the directories is running under the user's uid/gid (me, in  
this case).  Hence I now believe:

1.  I need to manually pre-create the next level down directories
         /var/dovecot/{control,index}/[a-z]

2.  Set these to be owned root:root with mode rwxrwxrwt

3.  I can periodically clean out 'old' files in the index tree.
     (Not sure about the control tree: hence Q1 and Q2 above.)


This seems to work OK... I just wanted to check I hadn't missed  
something simpler and blindingly obvious?

Cheers,
Mike B-)

-- 
The Computing Service, University of York, Heslington, York Yo10 5DD, UK
Tel:+44-1904-433811  FAX:+44-1904-433740

* Unsolicited commercial e-mail is NOT welcome at this e-mail address. *




More information about the dovecot mailing list