Depending of the client, the bug could appear every day. I know this is a
old bug, but I would appreciate to know more on this subject
The observation :
1. mbox is corrupted, first line (or more) is overwritten where first bytes
are
027 003 001 000 150 142 072 157 235 351 341 361 302 024 322 264
2/ there is always such messages in /var/log/mail.info
/usr/sbin/mlock[XXXX]: (64) fd not regular file
imapd[29107]: Killed (lost mailbox lock) user=XXX
(*)seems strange that fd is always 64
3/ when there is only one line like this one, no corruption
imapd[29107]: Killed (lost mailbox lock) user=XXX
My current conclusions are:
1/ mlock die (/usr/sbin/mlock) it return ? and log a message to syslog
2/ this code seems not ok in src/osdep/unix
int unix_lock (char *file,int flags,int mode,DOTLOCK *lock,int op)
{
int fd;
blocknotify_t bn = (blocknotify_t) mail_parameters
(NIL,GET_BLOCKNOTIFY,NIL);
(*bn) (BLOCK_FILELOCK,NIL);
/* try locking the easy way */
if (dotlock_lock (file,lock,-1)) {
/* got dotlock file, easy open */
if ((fd = open (file,flags,mode)) >= 0) flock (fd,op);
else dotlock_unlock (lock); /* open failed, free the dotlock */
}
/* no dot lock file, open file now */
else if ((fd = open (file,flags,mode)) >= 0) {
/* try paranoid way to make a dot lock file
*/
if (dotlock_lock (file,lock,fd)) {
close (fd); /* get fresh fd in case of timing
race */
if ((fd = open (file,flags,mode)) >= 0) flock (fd,op);
/* open failed, free the dotlock */
else dotlock_unlock (lock);
}
else flock (fd,op); /* paranoid way failed, just flock() it
*/
}
(*bn) (BLOCK_NONE,NIL);
return fd;
}
dotlock_lock (file,lock,fd) fails because fd not a regular file. It could
potentially fails for other reasons but never in my server. So my proposal
would be :
else {
close (fd);
fd = -1;
}
in place of
else flock (fd,op); /* paranoid way failed, just flock() it
*/
Any comment would be appreciated.
Michel
_______________________________________________
Imap-uw mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw