Earlier today I attempted to log in to my webmail and send someone a thing. I host my own email using good ol’ Postfix and Dovecot on a Linux VPS from Vultr.com and have for years. It’s worked perfectly and I’ve yet to have any issues… until this afternoon.
I was greeted by a new response from Roundcube, the webmail frontend I’ve installed so that it doesn’t feel like so much like I’m sitting in front of a database. After thinking a moment, it spit me back out to the log in screen with a comforting “Connection to storage server failed” message. So I logged in again. And again. And again. Same thing.
After accepting that I wasn’t going to fix it through strength of will alone, I started wading through Google, which sent me wading through forums and knowledge bases. I tried several smaller possible causes and fixes, but nothing worked. It was at this time I noticed no emails at all were coming from my server, not even to my phone client! Cue a little freak out.
I finally found a user of Plesk, the web hosting control panel, that had the exact same error using basically the exact same software. They figured out that their certificate directory had somehow disappeared which caused a breakdown of dovecot, the IMAP server that is used in a large number of Linux based email setups. My cert, a Let’s Encrypt cert that automatically renewed through my email and hosting infrastructure, was up for renewal in the near future so I went ahead and renewed it in case that was the problem. No good, still no email.
I decided to pursue the dovecot lead even though I didn’t have anything in dovecot or mail logs pointing to a dovecot failure. It was reportedly running fine according to my management interface. I eventually just tried running it from terminal and see what happened. Voila –
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 144: ssl_cert: Can't open file /home/othersite/ssl.cert: No such file or directory
So wow. I had removed an unrelated domain from my email server earlier on the day but the software hadn’t properly edited the dovecot configuration to remove references to that domain’s certificate. I simply backed up the conf:
cp /etc/dovecot/dovecot.conf /etc/dovecot/dovecot.conf.bak
…and edited it, removing the pointers to the removed domain and restarted dovecot. Boom. Emails like a mafk.