Here’s How to Perform mchk Plesk the Right Way

Here’s How to Perform mchk Plesk the Right Way

Mchk is a useful utility in Plesk to rebuild mail configuration files. Furthermore, it can restore settings for all mailboxes that you’ve created in Parallels Plesk Panel.

To put it more plainly, the mchk utility can set persmission and ownership for all the maiboxes. In this article, learn how you can perform mchk utility in Windows and Linux.

How to perform mchk Plesk the right way?

In this section learn how to perform mchk the right way. But since it’s going to trigger downtime, it’s recommended that you perform this during non-working hours.

That being said, here are the commands you need to execute in Parallels Plesk Panel for Windows:

C:\Users\Administrator>cd %plesk_bin%
C:\Parallels\Plesk\admin\bin>mchk.exe –all –fix=all
In Parallels Plesk Panel for Linux follow these steps:

Stop the mail server by executing this command:

/usr/local/psa/admin/sbin/mailmng –stop-service
Take a backup of the old handlers:

mkdir /root/temp
cp -a /usr/local/psa/handlers/before-* /root/temp/
cp -a /usr/local/psa/handlers/info /root/temp/
Execute this command to delete the handlers

rm -rf /usr/local/psa/handlers/before-*/*
rm -rf /usr/local/psa/handlers/info/*
Create new mail handlers by running the mchk utility

/usr/local/psa/admin/sbin/mchk –with-spam
Now start the mail service

/usr/local/psa/admin/sbin/mailmng –start-service
You’ve performed mchk in Plesk correctly.

Errors During mchk Plesk

Many people report error while performing the above task. Here are some of the most common ones and how to deal with it:
  • Plesk repair mail or mchk failure: mail_outgoing_restore… fail
You can get this error for multiple reasons. The first reason is because the Plesk repair mail or the /usr/local/psa/admin/sbin/mchk command fails. Here’s the complete error message:

==> Checking for: mail_outgoing_restore... fail
Some utilities have exited with errors:
The following files are present on the server:

# ls -al /usr/lib/plesk-9.0/mail_postfix_transport_restore
-rwxr-x--- 1 root root 348 Mar 1 2018 /usr/lib/plesk-9.0/mail_postfix_transport_restore

# ls -al /usr/lib/plesk-9.0/remote_mail_restore/mail_outgoing_restore
-rwxr-x--- 1 root root 358 Mar 1 2018 /usr/lib/plesk-9.0/remote_mail_restore/mail_outgoing_restore
The main reason behind this error is failed upgrade. Here are the steps involved in solving this:
  • Log in to server using SSH
  • Move the files to another location with this command:
# mv /usr/lib/plesk-9.0/remote_mail_restore/mail_postfix_transport_restore /root/plesksupport/
# mv /usr/lib/plesk-9.0/remote_mail_restore/mail_outgoing_restore /root/plesksupport/
  • Now reinstall the updates that were missing by executing this command:
# plesk installer update --repatch
  • mchk failed: mailsrv_conf_init… not found
The second error users face is another mchk failure error. Here’s what the error message reads:

# plesk repair mail
Reconfiguring all domains and mailboxes ......................... [2017-09-03 11:17:31] ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/mchk'] with exit code [1]
- mchk failed: ==> Checking for: mailsrv_conf_init... not found,
Other things you may notice are:
  • Symbolic link /usr/bin/which doesn’t point to /bin/which:
# ls -al /usr/bin/which
lrwxrwxrwx 1 root root 63 Aug 24 04:04 /usr/bin/which -> ../local/share/.config/yarn/global/node_modules/which/bin/which
  • There’s nothing in Mail authorization database and it’s empty:
# /usr/local/psa/admin/bin/mail_auth_dump
Authentication database contents:
| address |flags| password |
  • The records in /var/log/maillog looks like this:
Feb 3 06:59:30 mail plesk_saslauthd[25101]: failed mail authenticatication attempt for user 'example' (password len=9)
Feb 3 06:59:30 mail postfix/smtpd[25099]: warning: unknown[]: SASL LOGIN authentication failed: authentication failure
The main reason for this error is /usr/bin/which is located in an incorrect location.

To fix this error, here are the steps involved:
  • Using SSH, connect to the server
  • Execute the following command to change the location of /usr/bin/which:
# unlink /usr/bin/which
# ln -s /bin/which /usr/bin/which
# ls -al /usr/bin/which
lrwxrwxrwx 1 root root 10 Feb 4 04:15 /usr/bin/which -> /bin/which
  • In case you still get this error, you need to reinstall the which package by executing these commands:
# rpm -e --nodeps --noscripts which
# yum install which -y
  • Run Plesk repair mail once again
Doing so should fix this error.

So that’s how you work with mchk Plesk. For more assistance, get in touch with the support team.
First release
Last update
0.00 star(s) 0 ratings

More resources from kumkumsharma