Re: [Dovecot] mbox INBOX out of sync (?)

2013-01-26 Thread Tinguaro Barreno Delgado
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 6
  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 


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


*** Directory permissions ***

  kotoko:/var/mail# ls -la
  total 6
  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  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 

Re: [Dovecot] mbox INBOX out of sync (?)

2013-01-22 Thread Timo Sirainen
A guess: http://wiki2.dovecot.org/MailLocation/mbox -> /var/mail/ dotlocks

On 17.1.2013, at 8.30, Tinguaro Barreno Delgado  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
> 
> 



Re: [Dovecot] mbox INBOX out of sync (?)

2013-01-16 Thread Tinguaro Barreno Delgado

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



Re: [Dovecot] mbox INBOX out of sync (?)

2013-01-14 Thread Timo Sirainen
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?




[Dovecot] mbox INBOX out of sync (?)

2013-01-13 Thread Tinguaro Barreno Delgado

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.

Many thanks in advance.

Best wishes,
Tinguaro Barreno

-- logs --
Jan 11 21:58:19 master: Info: Dovecot v2.1.7 starting up (core dumps disabled)
Jan 11 21:58:33 auth: Debug: Loading modules from directory: 
/usr/lib/dovecot/modules/auth
Jan 11 21:58:33 auth: Debug: Module loaded: 
/usr/lib/dovecot/modules/auth/libdriver_mysql.so
Jan 11 21:58:33 auth: Debug: Module loaded: 
/usr/lib/dovecot/modules/auth/libdriver_pgsql.so
Jan 11 21:58:33 auth: Debug: Module loaded: 
/usr/lib/dovecot/modules/auth/libdriver_sqlite.so
Jan 11 21:58:33 auth: Debug: Loading modules from directory: 
/usr/lib/dovecot/modules/auth
Jan 11 21:58:33 auth: Debug: Module loaded: 
/usr/lib/dovecot/modules/auth/libauthdb_ldap.so
Jan 11 21:58:33 auth: Debug: auth client connected (pid=8658)
Jan 11 21:58:33 auth: Debug: client in: AUTH1   PLAIN   service=imap
secured session=1oL4jgnTGgDAqAwflip=192.168.12.2
rip=192.168.12.31   lport=10103
 rport=46874 resp=
Jan 11 21:58:33 auth: Debug: client out: OK 1   user=tbarreno
Jan 11 21:58:33 auth: Debug: master in: REQUEST 3219783681  86581   
38bcc0e7465cbb3aace197fa29f9319e
Jan 11 21:58:33 auth: Debug: ldap(tbarreno,192.168.12.31,<1oL4jgnTGgDAqAwf>): 
user search: base=dc=alameda,dc=inet scope=subtree 
filter=(&(objectClass=usuarioLocal)(username=tbarreno)) 
fields=homeDirectory,uidNumber,gidNumber
Jan 11 21:58:33 auth: Debug: ldap(tbarreno,192.168.12.31,<1oL4jgnTGgDAqAwf>): 
result: uidNumber=1004 gidNumber=1004 homeDirectory=/home/tbarreno
Jan 11 21:58:33 auth: Debug: master out: USER   3219783681  tbarreno
home=/home/tbarreno uid=1004gid=1004
Jan 11 21:58:33 imap-login: Info: Login: user=, method=PLAIN, 
rip=192.168.12.31, lip=192.168.12.2, mpid=8661, TLS
Jan 11 21:58:33 imap(tbarreno): Debug: Effective uid=1004, gid=1004, 
home=/home/tbarreno
Jan 11 21:58:33 imap(tbarreno): Debug: Namespace inbox: type=private, prefix=, 
sep=, inbox=no, hidden=no, list=yes, subscriptions=yes 
location=mbox:~/Mail:INBOX=/var/mail/tbarreno
Jan 11 21:58:33 imap(tbarreno): Debug: fs: root=/home/tbarreno/Mail, index=, 
control=, inbox=/var/mail/tbarreno, alt=
Jan 11 21:58:42 auth: Debug: auth client connected (pid=8663)
Jan 11 21:58:42 auth: Debug: client in: AUTH1   PLAIN   service=imap
secured session=EWyAjwnTGwDAqAwflip=192.168.12.2
rip=192.168.12.31   lport=10103
 rport=46875 resp=
Jan 11 21:58:42 auth: Debug: client out: OK 1   user=tbarreno
Jan 11 21:58:42 auth: Debug: master in: REQUEST 1092354049  86631   
13780b9ee679fecc08e3abdcd334049f
Jan 11 21:58:42 auth: Debug: ldap(tbarreno,192.168.12.31,): 
user search: base=dc=alameda,dc=inet scope=subtree 
filter=(&(objectClass=usuarioLocal)(username=tbarreno)) 
fields=homeDirectory,uidNumber,gidNumber
Jan 11 21:58:42 auth: Debug: ldap(tbarreno,192.168.12.31,): 
result: uidNumber=1004 gidNumber=1004 homeDirectory=/home/tbarreno
Jan 11 21:58:42 auth: Debug: master out: USER   1092354049  tbarreno
home=/home/tbarreno uid=1004gid=1004
Jan 11 21:58:42 imap-login: Info: Login: user=, method=PLAIN, 
rip=192.168.12.31, lip=192.168.12.2, mpid=8664, TLS
Jan 11 21:58:42 imap(tbarreno): Debug: Effective uid=1004, gid=1004, 
home=/home/tbarreno
Jan 11 21:58:42 imap(tbarreno): Debug: Namespace inbox: type=private, prefix=, 
sep=, inbox=no, hidden=no, list=yes, subscriptions=yes 
location=mbox:~/Mail:INBOX=/var/mail/tbarreno
Jan 11 21:58:42 imap(tbarreno): Debug: fs: root=/home/tbarreno/Mail, index=, 
control=, inbox=/var/mail/tbarreno, alt=



# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-3-amd64 x86_64 Debian 7.0 
auth_debug = yes
auth_verbose = yes
debug_log_path = /tmp/dovecot.log
info_log_path = /tmp/dovecot.log
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c
mail_debug = yes
mail_location = mbox:~/Mail:INBOX=/var/mail/%u
namespace inbox {
  inbox = yes
  location = 
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix = 
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
plugin {
  mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename
  mail_log_fields = uid box msgid size
  sieve = ~/.dovecot.sieve
  sieve_dir = ~/sieve
}
protocols = " imap"
servic