[Dovecot] locking questions

Stewart Dean sdean at bard.edu
Tue Apr 24 20:43:33 EEST 2007


I have Dovecot 1.0 in trial use by the IT staff, and have some locking 
questions

Background, the mail server runs procmail, sendmail and NFS exports the 
user homedir and mailbox to a) a login shell host and b) a mailing list 
services host.  It runs UWIMAP on the usual ports and dovecot on a 
arbitrary port number.  Because of concern with NFS and file access 
contention. I have the following dovecot.conf file access parms set:
   a) mbox_dirty_syncs =  no
   b) mbox_lazy_writes = no

1) I am seeing these errmsgs.  Are they anything I should be concerned 
about, or are they just the inevitable result of lock contention for 
mailboxes and folders by procmail, imap/dovecot and NFS?
> In syslog, I am seeing this: 
>
> Apr 23 18:46:34 mercury mail:err|error dovecot: IMAP(sdean): stat(/var/spool/mail/sdean.lock) failed: No such file or directory
> Apr 23 18:46:34 mercury mail:err|error dovecot: IMAP(sdean): file_lock_dotlock() failed with mbox file /var/spool/mail/sdean: No such file or directory
>
> While in maillog:
>
> Apr 23 18:46:34 mercury mail:err|error dovecot: IMAP(sdean): stat(/var/spool/mail/sdean.lock) failed: No such file or directory
> Apr 23 18:46:34 mercury mail:err|error dovecot: IMAP(sdean): file_lock_dotlock() failed with mbox file /var/spool/mail/sdean: No such file or directory
2) I earlier asked, but don't think I got an answer to this question:
> Everybody wants to lock differently
> 1) procmail (delivering for sendmail), which seems to want to use 
> dotlocking, fcntl and lockf locking; for whatever reasons, the compile 
> time tests seem to disallow flock.
> 2) UWIMAP which according to wiki.dovecot.org/Migration/UW uses:
> mbox_read_locks = flock
> mbox_write_locks = dotlock flock
> 3) I want to run dovecot in the same environment as I switch over, for 
> which the locking strategy is supposed to be (according to 
> http://wiki.dovecot.org/MboxLocking)
> mbox_read_locks = fcntl
> mbox_write_locks = dotlock fcntl
>
> Since that same page in the wiki says. "*It's important that all 
> software that's reading or writing to mboxes use the same locking 
> settings.",* I had recompiled procmail so it only usedotlocking and 
> fcntl (thus removing lockf in addition to the disallowed flock)...but 
> now I bumped into the Migration/UW page and there looks to be a conflict.
>
> I want to be able to run dovecot (for testing) and UWIMAP (for all 
> users/production)  at the same time (but never at the same time with 
> the same mailbox), but UWIMAP is doc'ed to use flock and Dovecot doesn't
> It's conceivable that the different locking strategies of UWIMAP and 
> Dovecot don't matter because they would never be going after the same 
> mail files (right?) but there is procmail, which has to interact with 
> both.  It appears to not use flock OK, even though the docs say it 
> should since UWIMAP expects it, and I've disabled lockf as well.  But 
> will there be a conflict with procmail and dovecot's use of fcntl, 
> which UWIMAP doesn't use?
>
> Help. 
3) I occasionally see "Disconnected for inactivity" message.  How long 
before that happens?  Is the interval configurable?

Thanks to all.  A brother sysadmin was stunned by performance gained in 
Dovecot.  He has to keep postmaster messages for a period and filters 
them into a separate folder...over a long weekend this folder could get 
to 1500 messages and 150MB...with UWIMAP he could only delete approx 800 
at a time and then had to wait 5-10 minutes for it to process.  With dc, 
he marked off the whole folder and it was gone in seconds.

-- 
====
Stewart Dean, Unix System Admin, Henderson Computer Resources 
Center of Bard College, Annandale-on-Hudson, New York  12504  
sdean at bard.edu  voice: 845-758-7475, fax: 845-758-7035



More information about the dovecot mailing list