Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.