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:
In Parallels Plesk Panel for Linux follow these steps:
Stop the mail server by executing this command:
Take a backup of the old handlers:
Execute this command to delete the handlers
Create new mail handlers by running the mchk utility
Now start the mail 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:
The following files are present on the server:
The main reason behind this error is failed upgrade. Here are the steps involved in solving this:
Other things you may notice are:
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:
So that’s how you work with mchk Plesk. For more assistance, get in touch with the support team.
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:
Code:
C:\Users\Administrator>cd %plesk_bin%
C:\Parallels\Plesk\admin\bin>mchk.exe –all –fix=all
Stop the mail server by executing this command:
Code:
/usr/local/psa/admin/sbin/mailmng –stop-service
Code:
mkdir /root/temp
cp -a /usr/local/psa/handlers/before-* /root/temp/
cp -a /usr/local/psa/handlers/info /root/temp/
Code:
rm -rf /usr/local/psa/handlers/before-*/*
rm -rf /usr/local/psa/handlers/info/*
Code:
/usr/local/psa/admin/sbin/mchk –with-spam
Code:
/usr/local/psa/admin/sbin/mailmng –start-service
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
Code:
==> Checking for: mail_outgoing_restore... fail
Some utilities have exited with errors:
/usr/lib64/plesk-9.0/remote_mail_restore/mail_outgoing_restore
Code:
# 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
- Log in to server using SSH
- Move the files to another location with this command:
Code:
# 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:
- mchk failed: mailsrv_conf_init… not found
Code:
# 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]
[FAILED]
- mchk failed: ==> Checking for: mailsrv_conf_init... not found,
skipped
- Symbolic link /usr/bin/which doesn’t point to /bin/which:
Code:
# 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:
Code:
# /usr/local/psa/admin/bin/mail_auth_dump
Authentication database contents:
+--------------------------------------+
| address |flags| password |
+--------------------------------------+
+--------------------------------------+
- The records in /var/log/maillog looks like this:
Code:
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[xxx.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication failure
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:
Code:
# 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:
Code:
# rpm -e --nodeps --noscripts which
# yum install which -y
- Run Plesk repair mail once again
So that’s how you work with mchk Plesk. For more assistance, get in touch with the support team.