[Dovecot] mbox INBOX out of sync (?)

Tinguaro Barreno Delgado tbarreno at yahoo.es
Sat Jan 26 23:04:19 EET 2013


Hi,

Many thanks, now it's fixed by changing permissions ("chmod a+rwxt /var/mail").

However I think there's something odd, maybe in the Debian package.

I've installed Dovecot on my laptop (same version 2.1.7, but this system is 32bits), I've copied the config files and mboxes, and do the same operation (delete a mail on INBOX). The difference appeared in the 'strace' output when locking the /var/mail/mbox:


*** Directory permissions ***
(No ACLs found)

- laptop (32bits):

  doki:/var/mail# ls -la
  total 11904
  drwxrwsr-x  2 root     mail     4096 ene 26 19:42 .
  drwxr-xr-x 15 root     root     4096 ago 18  2011 ..
  -rw-rw----  1 tbarreno mail 12163958 ene 26 19:42 tbarreno


- server (64bits):

  kotoko:/var/mail# ls -la
  total 77776
  drwxrwsr-x  3 root     mail       72 ene 26 19:20 .
  drwxr-xr-x 10 root     root      104 mar 12  2011 ..
  -rw-rw----  1 tbarreno mail 12258809 ene 26 19:20 tbarreno


*** User configuration ***

- laptop (32bits):

  doki:/var/mail# id dovecot
  uid=125(dovecot) gid=134(dovecot) grupos=134(dovecot)

- server (64bits):

  kotoko:/var/mail# id dovecot
  uid=104(dovecot) gid=105(dovecot) grupos=105(dovecot),8(mail)


*** Strace lines locking the file ***
(strace -f -o dovecot.strace dovecot -F)

- laptop (32bits):

  10145 time(NULL)                        = 1359225741
  10145 time(NULL)                        = 1359225741
  10145 lstat64("/var/mail/tbarreno.lock", 0xbfbcb7a0) = -1 ENOENT (No such file or directory)
  10145 open("/var/mail/tbarreno.lock", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0666) = 13
  10145 write(13, "10145:doki", 10)       = 10
  10145 time(NULL)                        = 1359225741
  10145 fstat64(13, {st_mode=S_IFREG|0600, st_size=10, ...}) = 0
  10145 close(13)

- server (64bits):

  10019 time(NULL)                        = 1359225347
  10019 time(NULL)                        = 1359225347
  10019 lstat("/var/mail/tbarreno.lock", 0x7fff4ce8dbf0) = -1 ENOENT (No such file or directory)
  10019 open("/var/mail/tbarreno.lock", O_RDWR|O_CREAT|O_EXCL, 0666) = -1 EACCES (Permission denied)
  10019 time(NULL)                        = 1359225347
  10019 geteuid()                         = 1004
  10019 geteuid()                         = 1004
  10019 socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 15
  10019 connect(15, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
  10019 close(15)
  ...
  10019 write(2, "\1\01010019 prefix=imap(tbarreno): \n", 32) = 32
  10008 <... epoll_wait resumed> {{EPOLLIN, {u32=2287516000, u64=140653876525408}}}, 21, 4294967295) = 1
  10019 write(2, "\1\00410019 file_dotlock_create(/var"..., 232 <unfinished ...>


After the /var/mail change, the strace was correct:


*** Directory permissions ***

  kotoko:/var/mail# ls -la
  total 77776
  drwxrwsrwt  3 root     mail       72 ene 26 19:58 .
  drwxr-xr-x 10 root     root      104 mar 12  2011 ..
  -rw-rw----  1 tbarreno mail 12258809 ene 26 19:20 tbarreno


*** Strace lines ***

  10347 time(NULL)                        = 1359226903
  10347 lstat("/var/mail/tbarreno.lock", 0x7fffc814e270) = -1 ENOENT (No such file or directory)
  10347 open("/var/mail/tbarreno.lock", O_RDWR|O_CREAT|O_EXCL, 0666) = 13
  10347 write(13, "10347:kotoko", 12)     = 12
  10347 time(NULL)                        = 1359226903
  10347 fstat(13, {st_mode=S_IFREG|0600, st_size=12, ...}) = 0
  10347 close(13)


Now the mbox is updated properly. Many thanks again.

Best wishes,

Tinguaro Barreno



On Tue, Jan 22, 2013 at 02:07:28PM +0200, Timo Sirainen wrote:
> A guess: http://wiki2.dovecot.org/MailLocation/mbox -> /var/mail/ dotlocks
> 
> On 17.1.2013, at 8.30, Tinguaro Barreno Delgado <tbarreno at yahoo.es> wrote:
> 
> > 
> > Hello again,
> > 
> > Permissions seems to be ok; all mboxes has 660 with group 'mail'.
> > 
> > ---
> > -rw-rw---- 1 tbarreno mail  1337814 ene 17 06:10 tbarreno
> > ---
> > 
> > However, the dovecot service was changed last October in Debian distro:
> > 
> > ---
> >  * Dovecot uses two system users for internal purposes now by
> >    default: "dovenull" and "dovecot". "dovenull" user is used by
> >    completely untrustworthy processes, while "dovecot" user is used
> >    for slightly more trusted processes.
> > ---
> > 
> > The "dovecot" user isn't included in the 'mail' group; I've tryed but it doesn't work.
> > 
> > I'll take a look at the Postfix configuration just to see if it's locking the files.
> > 
> > Many thanks again.
> > 
> > Best wishes,
> > Tinguaro Barreno
> > 
> > 
> > On Tue, Jan 15, 2013 at 08:43:13AM +0200, Timo Sirainen wrote:
> >> On Sun, 2013-01-13 at 20:38 +0100, Tinguaro Barreno Delgado wrote:
> >>> Hello all,
> >>> 
> >>> I've running a Dovecot's installation for several years without problems but since last system upgrade (Dec 26) I'm facing a kind of sync issue with the /var/mail/ inbox files.
> >>> 
> >>> We have got mobile and desktops IMAP clients (mostly Mozilla Thunderbird). The problem is that /var/mail/ files (mbox) aren't updated: we can delete mail from clients but they persist in de /var/mail, so the same user can see the mail again from other IMAP client.
> >>> 
> >>> Logs seems to be correct.
> >> 
> >> Sounds like Dovecot thinks the INBOX is read-only. What are the
> >> filesystem permissions in the files?
> >> 
> > 
> > -- 
> > Tinguaro Barreno Delgado
> > <tbarreno at alameda.homeip.net>
> > 

-- 
Tinguaro Barreno Delgado
<tbarreno at alameda.homeip.net>



More information about the dovecot mailing list