Problem with POP3/SMTP Dovecot can't mkdir - Permission denied

5 posts / 0 new
Last post
#1 Tue, 02/23/2010 - 03:59
moskit
moskit's picture

Problem with POP3/SMTP Dovecot can't mkdir - Permission denied

I have clean installation Debian 5.0 lenny and Virtualmin 3.76 GPL. I created new virtual server and e-mail user. I can send emails with TLS but I've got problem with receiving through POP3/SMTP (with SSL).

Log after connecting from MS Outlook 2007 in /var/log/mail.log:

Feb 23 09:32:03 hostname dovecot: pop3-login: Login: user=<user.domain>, method=PLAIN, rip=xxx.xxx.xxx.xxx, lip=xxx.xxx.xxx.xxx, TLS
Feb 23 09:32:03 hostname dovecot: POP3(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:32:03 hostname dovecot: POP3(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:32:03 hostname dovecot: POP3(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:32:03 hostname dovecot: POP3(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:32:03 hostname dovecot: POP3(user.domain): Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2010-02-23 09:32:03]
Feb 23 09:32:03 hostname dovecot: POP3(user.domain): Couldn't open INBOX top=0/0, retr=0/0, del=0/0, size=0

When I am logging to Usermin I can't read e-mails too. there is red message: An error occurred listing mail in this folder : Failed to login to POP3 server : Internal error occurred. Refer to server log for more information. [2010-02-23 09:31:38] and logs after this IMAP connection:

Feb 23 09:31:38 hostname dovecot: imap-login: Login: user=<user.domain>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Feb 23 09:31:38 hostname dovecot: imap-login: Login: user=<user.domain>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/index/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): mkdir(/var/lib/dovecot/control/user.domain/.INBOX) failed: Permission denied
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): Connection closed
Feb 23 09:31:38 hostname dovecot: IMAP(user.domain): Connection closed

Permissions in /var/lib/dovecot:

hostname:/var/lib/dovecot# ls -l
total 12
drwxrwxrwx 2 root root 4096 Feb 23 08:28 control
drwxrwxrwx 2 root root 4096 Feb 23 08:28 index
-rw-r--r-- 2 root root  230 Feb 23 08:28 ssl-parameters.dat

I did'n modify any files after installation. What can be wrong? This is a bug?

I read that changing in /etc/dovecot/dovecot.conf maildir from: mail_location = maildir:~/Maildir:INDEX=/var/lib/dovecot/index/%u:CONTROL=/var/lib/dovecot/control/%u to mail_location = maildir:~/Maildir solve the problem, but I think that it isn't the best way.

Have you got the same problem?

Tue, 02/23/2010 - 10:57
andreychek

The two ways to solve it are what you did, or changing the permissions of the dirs it's mentioning in /var/lib/dovecot to "777".

Either work, though I prefer what you had done there, that's what I have setup on my box :-) Putting the control files in the home directories prevents the needs for setting up anything with 777 permissions.

-Eric

Wed, 04/07/2010 - 17:51
gregc@netoverdr...

When copying SSL cert to dovecot it add the following lines

mail_location = maildir:~/Maildir:INDEX=/var/lib/dovecot/index/%u:CONTROL=/var/lib/dovecot/control/%u

Need to remove this to make it work again.

Mon, 06/28/2010 - 13:35
cre8net

I had the same problem...

chmod /var/lib/dovecot 755

drwxr-xr-x 4 dovecot dovecot 4096 Jun 25 05:05 dovecot did the trick...

(previously the permission were 750) drwxr-x--- 4 dovecot dovecot 4096 Jun 25 05:05 dovecot

Cheers, CG

Sun, 02/27/2011 - 22:21
djfenixchile

It's work. I change the values mail_location = maildir:~/Maildir:INDEX=/var/lib/dovecot/index/%u:CONTROL=/var/lib/dovecot/control/%u to mail_location = maildir:~/Maildir and solve the problem (note: I test in CentOS 5.5)

Topic locked