On Wed, 2011-09-14 at 13:32 +0200, Attila Nagy wrote: > Hello, > > I'm looking for the alternative of qmail's chmod -t (sticky bit on the > maildir root) for Dovecot. What I'm trying to achieve with this lock: > - Dovecot lmtp should give back a temporary error (so the email will be > deferred and re-delivered later) > - all other Dovecot daemons (pop, imap) should work as usual, but should > not alter maildir contents (they can modify their own files, like > indexes, logs etc) > > What is the best way to do this? If there is no such thing currently, > would it be hard to implement the sticky bit checking on the root?
dovecot-uidlist.lock basically does this. Dovecot comes with maildirlock utility to properly create it. How long would your locks be? They are assumed stale after 2 minutes if you don't update the mtime. Readers will block and if they're still locked after 2 minutes they'll abort (if mtime has been changed). There's also mail_max_lock_timeout setting that changes this wait (you could e.g. lower it only with lmtp).