[Dovecot] imap locking spool?

Scott Silva ssilva at sgvwater.com
Thu Mar 5 00:44:23 EET 2009


on 3-4-2009 11:23 AM Mark Hedges spake the following:
> On Tue, 3 Mar 2009, Timo Sirainen wrote:
>> If you set mbox_read_locks=dotlock, it should get created
>> whenever Dovecot is reading the mbox file. But it's
>> created ONLY during those times. For example opening a
>> mailbox whose index files are up-to-date doesn't cause
>> dotlock to be created. And when the mbox is actually being
>> read, the dotlock is deleted immediately after the IMAP
>> command is finished.
>>
>> Does openwebmail create longer existing locks?
> 
> *sigh*.  No.  It releases the locks as soon as it reads.
> (The CGI process ends.)  So if my script accesses by IMAP,
> which also releases the locks, openwebmail can change the
> folder in the meantime, regardless of what lock mechanism I
> use.
> 
> On Tue, 3 Mar 2009, Scott Silva wrote:
>> Looking at their list it seems as if flock is emulated by
>> calling the base fcntl locking routines, so you might be
>> OK on this one.
>>
>> http://openwebmail.acatysmoof.com/archive/html/owm-users/owm-users.200811/msg00006.html
> 
> That would be great if it were true, but when I set
> openwebmail to use 'flock', then open the spool file
> directly with Mail::Box using 'POSIX' locking to keep it
> locked, I am still able to access openwebmail, so I could
> still change the file.  If I use Mail::Box 'Flock' locking,
> it does lock me out of OWM.  I think the guy means that he's
> imported the flock constants from Fcntl, and he thinks this
> is the same as using Fcntl.  (A misconception that I had to
> battle with my predecessor's code, which assumed that a file
> was locked if you just imported the constants and did
> nothing.)
> 
> The lock code is here if anyone is interested:
> http://openwebmail.acatysmoof.com/dev/svnweb/index.pl/openwebmail/view/tags/2.53/src/cgi-bin/openwebmail/modules/filelock.pl
> 
> Hrmm, rope, poison, or jumping off a bridge?  At this point
> I would prefer a firing squad.  An excuse to smoke again.
You left out alcohol...
> 
> I think the only real answer is to lock the user's password,
> kill any dovecot processes with the username in verbose
> proctitle (-HUP? -KILL?), then run my expiration script on
> their mailboxes.  OR, use horde.
> 
> Mark
> 
Horde is probably the easiest option. I am running Horde now on my servers and
it was pretty painless to install. Horde groupware webmail edition has almost
all of the options that openwebmail has, and is much more stable and modern.
Only one old CentOS 4 server is still running openwebmail, and I have been
warning my users to switch over to Horde before I change out that server to a
new one running CentOS 5.

Another plus with a standards compliant webmail system is that you can run
maildir and your expiry scripts will have even less locking issues. You can
just look at mtime or atime on individual mail files and move them.

-- 
MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20090304/cf84a0e9/attachment.bin 


More information about the dovecot mailing list