3

This is my first time setting up an email sever, and have gone with Dovecot for the IMAP side. I've been following this tutorial.

When I try to login to the server, this is printed to the error log:

Apr 16 21:39:40 neonorb dovecot: imap(website@test.neonorb.com): Error: Relative home directory paths not supported: 0
Apr 16 21:39:40 neonorb dovecot: imap(website@test.neonorb.com): Error: Invalid user settings. Refer to server log for more information.
Apr 16 21:39:41 neonorb dovecot: imap(website@test.neonorb.com): Error: Relative home directory paths not supported: 0
Apr 16 21:39:41 neonorb dovecot: imap(website@test.neonorb.com): Error: Invalid user settings. Refer to server log for more information.

I've looked around, and this appears to be a "feature" that was never supported, it just never gave an error message.

I've looked through the comments of the tutorial, and other people were having this issue, they suggested removing the '/home/mailboxes/home/'||maildir as home, part, but this just caused another error:

Apr 16 21:45:36 neonorb dovecot: imap(website@test.neonorb.com): Error: User initialization failed: Initializing mail storage from mail_location setting failed: Ambiguous mail location setting, don't know what to do with it: 0 (try prefixing it with mbox: or maildir:)
Apr 16 21:45:36 neonorb dovecot: imap(website@test.neonorb.com): Error: Invalid user settings. Refer to server log for more information.
Apr 16 21:45:37 neonorb dovecot: imap(website@test.neonorb.com): Error: User initialization failed: Initializing mail storage from mail_location setting failed: Ambiguous mail location setting, don't know what to do with it: 0 (try prefixing it with mbox: or maildir:)
Apr 16 21:45:37 neonorb dovecot: imap(website@test.neonorb.com): Error: Invalid user settings. Refer to server log for more information.

I've been fiddling around with the config files, but haven't gotten anywhere.

Chris Smith
  • 205
  • 2
  • 10

3 Answers3

2

It appears dovecot is finding the mail directory location. However it needs to know which type of delivery to use. Your maildir entries should be prefixed with either mbox:, maildir or another supported type. I prefer maildir:.

Alternatively add back the mailbox location:

mail_location = maildir:~/Maildir

or use the username to set the location using your preferred directory in place of /home:

mail_location = maildir:/home/%u/Maildir
BillThor
  • 27,737
  • 3
  • 37
  • 69
  • I added the first option you suggested in `/etc/dovecot/conf.d/10-mail.conf` and I got the same "ambiguous mail location" error I mentioned at the bottom of my question. – Chris Smith Apr 17 '16 at 17:12
  • Ah, the DO tutorial removed the call to load the stuff in `conf.d/` so that didn't work. – Chris Smith Apr 17 '16 at 17:44
2

I added these two lines (from the DO tutorial) to my /etc/dovecot/dovecot.conf:

mail_home = /home/mailboxes/home/
mail_location = maildir:/home/mailboxes/maildir/

I also removed the same things from the SQL query from /etc/dovecot/dovecot-sql.conf.

And now it works!

Chris Smith
  • 205
  • 2
  • 10
0

In /etc/dovecot/dovecot-sql.conf.ext set user_query:

user_query = SELECT CONCAT('/var/mail/virtual/',maildir) AS home, 5000 AS uid, 5000 AS gid FROM mailbox WHERE username = '%u'

Where /var/mail/virtual/ is top directory for maildirs.

Paul
  • 3,037
  • 6
  • 27
  • 40