How to recreate mail handlers in Parallels Plesk 10.3 and earlier versions

Created:

2016-11-16 13:00:57 UTC

Modified:

2017-08-16 16:10:25 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to recreate mail handlers in Parallels Plesk 10.3 and earlier versions

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 10.x for Linux
  • Plesk 9.x for Linux

Information

This article is for Parallels Plesk versions 10.3 and earlier.

For later versions, please see this article:

How to recreate mail handlers in Parallels Plesk 10.4 and later

Recreating corrupted mail handlers only

This is the recommended option because it preserves any custom handlers unless they are broken.

  1. Stop the mail service:

    # /usr/local/psa/admin/sbin/mailmng --stop-service`
  2. Find all corrupted mail headers using the following command:

    # find /usr/local/psa/handlers/before-* -type f | while read h ; do [ ! -d /usr/local/psa/handlers/info/$(basename $h) ] && echo $h  ; done
    /usr/local/psa/handlers/before-local/recipient/test@domain.tld/20-drweb-wDB2eC
    #

    The command returns the names of mail handlers that do not have executable binary links.

    If you get an empty output, recreate all mail handlers as described at the end of this article.

  3. Remove the corrupted files. Do not forget to replace the file name with the actual file name(s):

    # rm -f /usr/local/psa/handlers/before-local/recipient/test@domain.tld/20-drweb-wDB2eC
  4. Run the mchk utility to recreate mail handlers. The output may look similar to the following:

    # /usr/local/psa/admin/sbin/mchk --with-spam
    ==> Checking for: mail_spam_restore... ok
    ==> Checking for: mailsrv_conf_init... ok
    ==> Checking for: mail_mailbox_restore... ok
    ==> Checking for: mailsrv_entities_dump... ok
    ==> Checking for: mail_admin_aliases... ok
    ==> Checking for: mail_auth_dump... ok
    ==> Checking for: mailman_lists_dump... ok
    ==> Checking for: mail_responder_restore... ok
    ==> Checking for: mail_drweb_restore... ok
    ==> Checking for: mail_kav_restore... not exists
    ==> Checking for: mail_spf_restore... ok
    ==> Checking for: mail_dk_restore... ok
    ==> Checking for: mail_grey_restore... ok
    #
  5. Start the mail service:

    # /usr/local/psa/admin/sbin/mailmng --start-service

Recreating all mail handlers

If the above procedure did not help, try the steps below.

Warning : All custom handlers will be lost and will need to be recreated.****

  1. Stop the mail service:

    # /usr/local/psa/admin/sbin/mailmng --stop-service
  2. Back up old handlers:

    # mkdir /root/temp
    # cp -a /usr/local/psa/handlers/before-* /root/temp/
    # cp -a /usr/local/psa/handlers/info /root/temp/
  3. Delete all mail handlers:

    # rm -rf /usr/local/psa/handlers/before-*/*
    # rm -rf /usr/local/psa/handlers/info/*
  4. Run the mchk utility to recreate mail handlers:

    # /usr/local/psa/admin/sbin/mchk --with-spam
  5. Start the mail service:

    # /usr/local/psa/admin/sbin/mailmng --start-service

Additional information

Parallels Plesk version 9.x provides the ability to configure and use custom mail handlers: Plesk 9.2 for Linux/Unix:: Modules API Reference

These custom handlers do not correspond to records in the Plesk database, so mchk will not reconfigure them automatically. This is why it is recommended to only rebuild the corrupted mail handlers.

Have more questions? Submit a request
Please sign in to leave a comment.