Figuring how to do “mchk” Utility in Plesk? We can help you.
This utility rebuilds all mail configuration files. In addition, it restores the settings for all mailboxes created in Parallels Plesk Panel.
As part of our Server Management Services, we assist our customers with several Plesk queries.
Today, let’s see how our Support Engineers easily fix this error for our customers.
Why is mchk utility?
Mchk plesk utility sets proper ownership and permissions for all mailboxes. And, It rebuilds mail server control files’ mailboxes settings.
In addition, it sets appropriate permissions for all the related files. In short, it will rebuild the mail configuration or recreate the broken mail handlers.
How do we do mchk plesk?
Recently, one of our customers approached us with the request to provide him the steps to perform mchk utility in both Windows and Linux.
Since it will cause some downtime, our Support Techs recommend running it only during off-peak hours.
The steps we follow both in Linux and Windows are given below:
We usually follow the steps below:
-
Parallels Plesk Panel for Windows
C:\Users\Administrator>cd %plesk_bin% C:\Parallels\Plesk\admin\bin>mchk.exe –all –fix=all
-
Parallels Plesk Panel for Linux
- Firstly, we stop the mail service
/usr/local/psa/admin/sbin/mailmng –stop-service
- Next, backup old handlers:
mkdir /root/temp cp -a /usr/local/psa/handlers/before-* /root/temp/ cp -a /usr/local/psa/handlers/info /root/temp/
- Then, we delete all the mail handlers:
rm -rf /usr/local/psa/handlers/before-*/* rm -rf /usr/local/psa/handlers/info/*
- After that, we run mchk utility to recreate mail handlers:
/usr/local/psa/admin/sbin/mchk –with-spam
- Finally, we start the mail service:
/usr/local/psa/admin/sbin/mailmng –start-service
By performing these steps we helped our customer with his query regarding mchk.
Our Engineers are always here for finding solutions for our customer’s problems.
Few Common Errors of mchk plesk
Moving ahead, let us focus on a few errors and its fix in detail.
a) Plesk repair mail or mchk fails: mail_outgoing_restore… fail
The symptoms of this error include:
- Plesk repair mail or /usr/local/psa/admin/sbin/mchk command fails:
==> Checking for: mail_outgoing_restore... fail Some utilities have exited with errors: /usr/lib64/plesk-9.0/remote_mail_restore/mail_outgoing_restore
- The following files 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 major cause of this error is a failed upgrade.
In order to solve this, our Support Techs follow the below steps:
- Log in to the server over SSH
- Move the files to the other location:
# 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/
- Reinstall latest updates:
# plesk installer update --repatch
b) mchk failed: mailsrv_conf_init… not found
- Execution of plesk repair mail fails:
# 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 points not 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
- Mail authorization database is empty:
# /usr/local/psa/admin/bin/mail_auth_dump Authentication database contents: +--------------------------------------+ | address |flags| password | +--------------------------------------+ +--------------------------------------+
- In /var/log/maillog there are records like:
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
Incorrect location of /usr/bin/which is the cause of this error.
In order to resolve this our Support Techs suggest the following steps:
- Connect to the server via SSH
- Change 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
- If the issue persists, reinstall which package:
# rpm -e --nodeps --noscripts which # yum install which -y
- Run plesk repair mail again.
[Need further assistance with mchk utility? – We’ll help you]
Conclusion
In short, we discussed in detail on mchk utility in Plesk and saw how our Support Engineers help the customers with this.
0 Comments