Dovecot says “Couldn’t open INBOX: Mailbox doesn’t exist: INBOX”

Suddenly you get a message:

Sending of password did not succeed. Mail server [yourservernamehere] responded: Couldn’t open INBOX: Mailbox doesn’t exist: INBOX

alert

One possible reason is that the mailbox file has indeed disappeared.

This happened to me recently, when I was playing with Dovecot mail server settings and moved away some old mailbox files without much thinking about the effects.

The bright side is that the malfunction can be fixed extremely easy: just create a blank file with the name of the user it is for, in this example let’s assume the name of the user is lightbox.

So you just go to the /var/spool/mail and say

touch lightbox

Voila! It should be working now.

If it doesn’t, check that the size of the file is zero! Say:

ls -l

In my case I initially made a mistake by creating the “empty” file with echo “” > lightbox, but it actually produced for me a file of 1 byte size, and not a zero sized file. This resulted in error:

Sending of username did not succeed. Mail server [yourservernamehere] responded: Mailbox isn’t a valid mbox file

alert2

Also, to avoid receiving error message like “cannot update mailbox /var/mail/lightbox for user lightbox. cannot open file: Permission denied” and for the sake of good order, change ownership and permissions for the file:

chown lightbox:mail lightbox
chmod 600 lightbox

Then check again with:

ls -l

It should look something like this:

-rw——- 1 lightbox mail 0 Jun 25 14:29 lightbox

i.e. only the particular user shall be able to read and write the file.

P.S. Tested on Ubuntu 12.04

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s