Dovecot: ERR No INBOX for user

Did something stupid a few days ago, After Opera 9.5 Alpha did something stupid with my email, I decided to clear out all email on my server..

Not a hard thing to do.. SSH to server, echo > ~/mail/username Check the list with the ‘mail‘ app, Yep all fine.. emails cleared; Then went out for a few days.

Come back today and i have no email? Strange, I send myself a test message, Doesnt turn up in my POP3 inbox.. SSH in, whoa, 92 messages on the server (using the ‘mail‘ command again), Why isnt it coming through POP3 then?

Started investigating, grabed telnet and connected to the mail server, Here’s what i got:

+OK dovecot ready.
USER my_username
PASS my_super_secret
+OK Logged in.
-ERR No INBOX for user.

Yep.. Somethings screwed on the server, But what? I didnt touch anything!

After a lot of screwing around and re-setting permissions and all that, I found the error, Can you see the error?

Dovecot mail error

No, I’m not supprised if you cant see it, It didnt hit me at first either, Especially when  mail was showing all my mail correctly.

Turned out, Dovecot doesnt like the new line at the start of the file, It bails out thinking its not a valid inbox…. removed the new line and everythings off and running fine again. Shame i bothered the hosts support a few hours ago, But at least i had fixed it before they started pulling their hair out :)