LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-02-2014, 08:26 AM   #1
grob115
Member
 
Registered: Oct 2005
Posts: 542

Rep: Reputation: 32
Dovecot Couldn't open INBOX


Hi, I have everything setup for Dovecot and user can login from Outlook. However, I think I have not setup the mail_location variable correctly because Dovecot is complaining that it has trouble creating a directory as shown in the /var/log/maillog.

Looking at Dovecot's wiki, it says "INBOX path can be specified to exist elsewhere than the rest of the mailboxes." I'm not getting it. Why do I have mails at more than one location, and what I might have done wrong here?

10-mail.conf
Code:
# See doc/wiki/Variables.txt for full list. Some examples:
#
#   mail_location = maildir:~/Maildir
    mail_location = mbox:/var/mail:INBOX=/var/mail/%u
#   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
/var/log/maillog
Code:
Jan  2 05:44:12 localhost dovecot: master: Dovecot v2.0.9 starting up (core dumps disabled)
Jan  2 05:44:23 localhost dovecot: pop3-login: Login: user=<testuser>, method=PLAIN, rip=192.168.1.2, lip=192.168.1.132, mpid=36538
Jan  2 05:44:23 localhost dovecot: pop3(testuser): Error: mkdir(/var/mail/.imap) failed: Permission denied
Jan  2 05:44:23 localhost dovecot: pop3(testuser): Error: Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2014-01-02 05:44:23]
Jan  2 05:44:23 localhost dovecot: pop3(testuser): Couldn't open INBOX top=0/0, retr=0/0, del=0/0, size=0
 
Old 01-02-2014, 06:39 PM   #2
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware, Debian, Gentoo, FreeBSD, OpenBSD
Posts: 208

Rep: Reputation: 41
What is mail_privileged_group set to? What permission does mail_location (i.e. /var/mail) have? On a quick look, to me it seems you don't have these two things synchronised with each other.
 
Old 01-03-2014, 12:39 PM   #3
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Quote:
What is mail_privileged_group set to?
In my /etc/dovecot/conf.d/10-mail.conf, I have the following set.
Code:
mail_privileged_group = mail
Quote:
What permission does mail_location (i.e. /var/mail) have? On a quick look, to me it seems you don't have these two things synchronised with each other.
This is the test I have executed to check whether my OS is using mbox or maildir, and which directories are used after having sent a mail to an internal user.
Code:
[tester@mail ~]# echo "Hello me" | mail -s "Dovecot test" $USER
[tester@mail ~]# for mbox in /var/mail/$USER /var/spool/mail/$USER ~/mbox ~/mail/* ~/*; do
>   grep -q "Dovecot test" $mbox && echo "mbox: $mbox"
> done
mbox: /var/mail/tester
mbox: /var/spool/mail/tester
grep: /home/tester/mbox: No such file or directory
grep: /home/tester/mail/*: No such file or directory
Code:
[tester@mail ~]# grep -q "Dovecot test" ~/Maildir/new/* 2>/dev/null && echo "Maildir: ~/Maildir"
[tester@mail ~]# ls -li /var/mail/tester /var/spool/mail/tester
392130 -rw-rw----. 1 tester mail 1639 Jan  2 04:40 /var/mail/tester
392130 -rw-rw----. 1 tester mail 1639 Jan  2 04:40 /var/spool/mail/tester
You have mail in /var/spool/mail/tester
Code:
[tester@mail ~]#  ls -ld /var/mail
lrwxrwxrwx. 1 root root 10 Jan  2  2014 /var/mail -> spool/mail
[tester@mail ~]#  ls -ld /var/spool/mail
drwxrwxr-x. 2 root mail 4096 Jan  2 04:40 /var/spool/mail

Based on the second and last check, we know the directories /var/spool/mail and anything under it, are owned by tester and the group called "mail". With the below setting already applied, Dovecot should have the correct permission to access and create anything under /var/spool/mail.
Code:
mail_privileged_group = mail
So is the following in /etc/dovecot/conf.d/10-mail.conf the correct setting based on the directory lay out I have?
Code:
mail_location = mbox:/var/mail:INBOX=/var/mail/%u

Last edited by grob115; 01-03-2014 at 12:41 PM.
 
Old 01-03-2014, 07:02 PM   #4
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware, Debian, Gentoo, FreeBSD, OpenBSD
Posts: 208

Rep: Reputation: 41
It all looks ok, except you are checking maildir locations as well as mbox locations, which is unnecessary.

Have a read of /usr/share/doc/dovecot-common/wiki/MailLocation.txt.gz , especially the last few paragraphs on the location of the INDEX. I suspect your problem lies there since your log specifically mentions it cannot create the (INDEX) file in /var/mail/.imap .

I suspect that specifying the location of INDEX as you do with INBOX will help, since autodetection will not create missing entries whereas manually specifying their location will cause their creation if they don't exist.
 
Old 01-04-2014, 11:27 AM   #5
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Okay I got it to work with the following.
Code:
mail_location = mbox:~/mail:INBOX=/var/spool/mail/%u:LAYOUT=maildir++:INDEX=~/mail/index:CONTROL=~/mail/control
 
Old 01-04-2014, 06:22 PM   #6
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware, Debian, Gentoo, FreeBSD, OpenBSD
Posts: 208

Rep: Reputation: 41
Except you are specifying both mbox and maildir formats at the same time. Are you doing that intentionally (I know nothing about Outlook)?
 
Old 01-08-2014, 09:37 AM   #7
grob115
Member
 
Registered: Oct 2005
Posts: 542

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by padeen View Post
Except you are specifying both mbox and maildir formats at the same time. Are you doing that intentionally (I know nothing about Outlook)?
That's basically following through the document located at the path you provided I found another document that discusses about the limitation of mbox for not being able to have sub-folders without issues and suggested something along the line of what I posted.
 
Old 01-08-2014, 06:12 PM   #8
padeen
Member
 
Registered: Sep 2009
Location: Perth, W.A.
Distribution: Slackware, Debian, Gentoo, FreeBSD, OpenBSD
Posts: 208

Rep: Reputation: 41
Yes, I see that now. Further info at http://wiki2.dovecot.org/MailLocation
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Dovecot pop3 Server, cannot chown, mkdir and open /INBOX ponganthony Linux - Server 4 05-20-2011 02:57 PM
Horde/IMP with dovecot on CentOS 5.3 - no folders other than inbox billymayday Linux - Server 2 05-16-2009 05:35 PM
Dovecot + Sendmail -- mbox and INBOX Spechal Linux - Server 15 11-06-2008 09:13 PM
Sendmail & dovecot Inbox problem fatum112 Linux - Networking 2 09-23-2007 01:51 AM
Dovecot: no inbox for user error Coomkeen Linux - Server 2 10-06-2006 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration