[Dovecot] Error on mailbox file
Hi!
I'm running Postfix 2.2.9 as MTA. I have several mail clients , such as
Outlook 2000/xp/2007. The clients comunicate to the MTA using pop3/smtp
protocols.
I have also installed Webmail Squirrel for the internet users. Squirrel
needs an Imap server, so i have utilized Dovecot 1.2.6.
To authenticate users , i use pam_winbbind to validate users to my NT
domain.
Here is my problem : Today i checked my /var/log/mail log and this took my attention :
Sep 29 08:25:07 host1 dovecot: imap-login: Login: user=<USER>,
method=PLAIN, rip=172.20.22.12, lip=172.20.22.14
Sep 29 08:25:07 host1 dovecot: IMAP(user): mail_location: mbox:
mkdir(/home/NT-DOMAIN/user/mail) failed: Permission denied
(euid=10188(user) egid=10001(domain users) missing +w perm: /home)
Sep 29 08:25:07 host1 dovecot: IMAP(user): Fatal: Namespace initialization
failed
Here , i assume the user put his user name in CAPS (USER), and that i
generating an error. Then Dovecot tries to create the directory
/home/NT-DOMAIN/user/mail. In my dovecot.conf file , i have :
mail_location = mbox:~/mail:INBOX=/var/mail/%u
Now , the log continues :
Sep 29 08:25:18 host1 dovecot: imap-login: Login: user=<user>,
method=PLAIN, rip=172.20.22.12, lip=172.20.22.14
Sep 29 08:25:18 host1 dovecot: IMAP(user): mail_location: mbox:
mkdir(/home/NT-DOMAIN/user/mail) failed: Permission denied
(euid=10188(user) egid=10001(domain users) missing +w perm: /home)
Sep 29 08:25:18 host1 dovecot: IMAP(user): Fatal: Namespace initialization
failed
Here the user re-enters the user, now correctly, but the problem persists .
Finally , a could see this new log entry :
Sep 29 10:50:43 host1 postfix/local[19663]: 50B98441E0:
to=<user@domain.com>, orig_to=<user@domain.com>, relay=local, delay=0,
status=bounced (cannot access mailbox /var/mail/user for user user. cannot
open file: Permission denied)
Here some user tries to send an email to this user , and a permission
denied error occurs.
Watching the permissions on the file : -rw------- 1 user users 1499655 2010-09-29 02:18 /var/mail/user
Maybe some Dovecot process is blocking the file access ?
List of Dovecot process: ps ax | grep dovecot 25997 ? Ss 0:07 /usr/sbin/dovecot 15399 ? S 0:02 dovecot-auth 20614 ? S 0:00 dovecot-auth -w
How can i fix this issue?
Thank you very much ! Augusto
On Wed, 2010-09-29 at 14:26 +0000, augustocasagrande@gmail.com wrote:
Sep 29 08:25:07 host1 dovecot: imap-login: Login: user=<USER>,
method=PLAIN, rip=172.20.22.12, lip=172.20.22.14 Sep 29 08:25:07 host1 dovecot: IMAP(user): mail_location: mbox:
mkdir(/home/NT-DOMAIN/user/mail) failed: Permission denied
(euid=10188(user) egid=10001(domain users) missing +w perm: /home) Sep 29 08:25:07 host1 dovecot: IMAP(user): Fatal: Namespace initialization
failedHere , i assume the user put his user name in CAPS (USER), and that i
generating an error. Then Dovecot tries to create the directory
/home/NT-DOMAIN/user/mail.
So what would have been the correct directory for this user?
If the problem is caps, you can try if auth_username_format=%Lu helps. If not, send full dovecot -n output.
The correct directory is /home/user/mail/
My dovecot -n :
# 1.2.6: /etc/dovecot/dovecot.conf # OS: Linux 2.6.16.13-4-smp i686 SUSE LINUX 10.1 (i586) protocols: imap listen: my-ip ssl: no disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable: /usr/lib/dovecot/imap-login mail_privileged_group: mail mail_location: mbox:~/mail:INBOX=/var/mail/%u mbox_write_locks: fcntl dotlock lda: postmaster_address: postmaster@example.com mail_plugin_dir: /usr/lib/dovecot/modules/lda auth default: passdb: driver: pam userdb: driver: passwd
Recently i have made this change in the conf file :
mbox_write_locks: fcntl dotlock
Thanks !
El 01/10/2010 13:29, Timo Sirainen <tss@iki.fi> escribió:
On Wed, 2010-09-29 at 14:26 +0000, augustocasagrande@gmail.com wrote:
Sep 29 08:25:07 host1 dovecot: imap-login: Login: user=,
method=PLAIN, rip=172.20.22.12, lip=172.20.22.14
Sep 29 08:25:07 host1 dovecot: IMAP(user): mail_location: mbox:
mkdir(/home/NT-DOMAIN/user/mail) failed: Permission denied
(euid=10188(user) egid=10001(domain users) missing +w perm: /home)
Sep 29 08:25:07 host1 dovecot: IMAP(user): Fatal: Namespace
initialization
failed
Here , i assume the user put his user name in CAPS (USER), and that i
generating an error. Then Dovecot tries to create the directory
/home/NT-DOMAIN/user/mail.
So what would have been the correct directory for this user?
If the problem is caps, you can try if auth_username_format=%Lu helps.
If not, send full dovecot -n output.
On Fri, 2010-10-01 at 16:56 +0000, augustocasagrande@gmail.com wrote:
mail_location: mbox:~/mail:INBOX=/var/mail/%u
So it uses ~/ and %u here..
passdb: driver: pam userdb: driver: passwd
So home should be taken from NSS lookup..
mkdir(/home/NT-DOMAIN/user/mail) failed: Permission denied
This means the NSS lookup returned /home/NT-DOMAIN/user as the user's home directory.
Are the users normally logging in as "user" or "NT-DOMAIN/user"? What does it log with auth_debug=yes?
Anyway, this looks more like a configuration problem on your pam and passwd (=NSS) side.
Ok, thanks i'll check it and i will let you know.
Now , what about the other problem?
[quote]
Sep 29 10:50:43 host1 postfix/local[19663]: 50B98441E0:
to=<user@domain.com>, orig_to=<user@domain.com>, relay=local, delay=0,
status=bounced (cannot access mailbox /var/mail/user for user user. cannot
open file: Permission denied)
Here some user tries to send an email to this user , and a permission
denied error occurs.
Watching the permissions on the file : -rw------- 1 user users 1499655 2010-09-29 02:18 /var/mail/user
Maybe some Dovecot process is blocking the file access ? [/quote]
It's related to the nss lookup?
thanks !
El 01/10/2010 14:23, Timo Sirainen <tss@iki.fi> escribió:
On Fri, 2010-10-01 at 16:56 +0000, augustocasagrande@gmail.com wrote:
mail_location: mbox:~/mail:INBOX=/var/mail/%u
So it uses ~/ and %u here..
passdb:
driver: pam
userdb:
driver: passwd
So home should be taken from NSS lookup..
mkdir(/home/NT-DOMAIN/user/mail) failed: Permission denied
This means the NSS lookup returned /home/NT-DOMAIN/user as the user's
home directory.
Are the users normally logging in as "user" or "NT-DOMAIN/user"? What
does it log with auth_debug=yes?
Anyway, this looks more like a configuration problem on your pam and
passwd (=NSS) side.
On Fri, 2010-10-01 at 18:47 +0000, augustocasagrande@gmail.com wrote:
Now , what about the other problem?
[quote] Sep 29 10:50:43 host1 postfix/local[19663]: 50B98441E0:
to=<user@domain.com>, orig_to=<user@domain.com>, relay=local, delay=0,
status=bounced (cannot access mailbox /var/mail/user for user user. cannot
open file: Permission denied)
Note the postfix/local above. Dovecot has nothing to do with this problem, it's Postfix's LDA that is trying to deliver the mail and failing.
Alternatively you could switch to Dovecot LDA: http://wiki.dovecot.org/LDA
I suposed it was a Postfix issue , but caused by another program locking
the file.
This is only a guessing.
Is that right ?
El , Timo Sirainen <tss@iki.fi> escribió:
On Fri, 2010-10-01 at 18:47 +0000, augustocasagrande@gmail.com wrote:
Now , what about the other problem?
[quote]
Sep 29 10:50:43 host1 postfix/local[19663]: 50B98441E0:
to=user@domain.com>, orig_to=user@domain.com>, relay=local, delay=0,
status=bounced (cannot access mailbox /var/mail/user for user user.
cannot
open file: Permission denied)
Note the postfix/local above. Dovecot has nothing to do with this
problem, it's Postfix's LDA that is trying to deliver the mail and
failing.
Alternatively you could switch to Dovecot LDA:
Ok, fixed . It was an nsswitch issue. My priority order was files ,
winbind . I remove winbind and it's working again. Thanks for your help !
El 01/10/2010 17:34, augustocasagrande@gmail.com escribió:
I suposed it was a Postfix issue , but caused by another program locking
the file.
This is only a guessing.
Is that right ?
El , Timo Sirainen tss@iki.fi> escribió:
On Fri, 2010-10-01 at 18:47 +0000, augustocasagrande@gmail.com wrote:
Now , what about the other problem?
[quote]
Sep 29 10:50:43 host1 postfix/local[19663]: 50B98441E0:
to=user@domain.com>, orig_to=user@domain.com>, relay=local, delay=0,
status=bounced (cannot access mailbox /var/mail/user for user user.
cannotopen file: Permission denied)
Note the postfix/local above. Dovecot has nothing to do with this
problem, it's Postfix's LDA that is trying to deliver the mail and
failing.
Alternatively you could switch to Dovecot LDA:
participants (2)
-
augustocasagrande@gmail.com
-
Timo Sirainen