Repairing qmail mailboxes (with Plesk 8.x)

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, June 06, 2008

Follow me on Twitter as @mattiasgeniar

If you’ve used Plesk for long enough, you’ll eventually run in to the dreadfull “This address no longer accepts mail.” message bounces. Even though the mail folders exist on the server, and in Plesk, mail won’t be delivered to that address. Let’s fix that.

First of all, make sure the mailboxes exist.

[root@vps]# cd /var/qmail/mailnames/<domain>/<mailboxname>

If it doesn’t, then you can safely delete the mailbox you see in Plesk, and re-create one. This can occur when you create a mailbox, but for some reason qmail can’t actually create it. Plesk thinks it’s created, thus adds it to its internal database, and you think it exists. Well, it doesn’t :-) .

Another way to fix invalid mailboxes, is to run the Plesk qmail utility. This will check all the qmail config files, and rebuild them according to the Plesk database. This will also fix the Spamassasin config files.

[root@vps]# /usr/local/psa/admin/sbin/mchk ---with-spam

Here’s a list of other possible parameters, you can use it to check only mailboxes (without spamassasin), or only spamassasin (without the mailboxes).

[root@vps sbin]# ./mchk
Usage: mchk [OPTION]
  Restore settings for all mailboxes.
  --without-spam [--daemon-mode]
         restore all settings except for SpamAssassin configuration
  --with-spam [--daemon-mode]
         restore all settings
  --spam-only [--daemon-mode]
         restore only SpamAssassin settings

Other error messages that could indicate this problem (but which might as well mean something entirely different, just for fun) are:

  • Hi. This is the qmail-send program at . I’m afraid I wasn’t able to deliver your message to the following addresses. This is a permanent error; I’ve given up. Sorry it didn’t work out
  • Sorry, no mailbox here by that name. (#5.1.1)


Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.