• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Plesk repair mail fails when not default DKIM selector in use

imrelaszlo84

New Pleskian
Server operating system version
Ubuntu 22.04.3
Plesk version and microupdate number
18.0.56 #4
Hello!

We have chosen an alternative default DKIM selector for a new server.
According to the relevant changelog, we've added this setting to panel.ini file:

[mail]
dkimDefaultSelector = newselector

After this, when we run plesk repair mail, error message generated:

Code:
Reconfigure all domains and mailboxes? [Y/n] Y
    Reconfiguring all domains and mailboxes ......................... [2023-11-28 15:45:55.536] 28119:6565fcd9307d8 ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/mchk'] with exit code [1]
[FAILED]
    - mchk failed: ==> Checking for: mailsrv_conf_init... ok
      ==> Checking for: mail_handlers_init... ok
      ==> Checking for: mailsrv_entities_dump... ok
      ==> Checking for: mail_admin_aliases... ok
      ==> Checking for: mail_auth_dump... ok
      ==> Checking for: mailman_lists_dump... not found, skipped
      ==> Checking for: mail_kav8_restore... ok
      ==> Checking for: mail_responder_restore... ok
      ==> Checking for: mail_imap_restore... ok
      ==> Checking for: mail_add_from_restore... ok
      ==> Checking for: mail_spam_restore... ok
      ==> Checking for: mail_grey_restore... ok
      ==> Checking for: mail_mailbox_restore... ok
      ==> Checking for: mail_spf_restore... ok
      ==> Checking for: mail_dk_restore... fail
      ==> Checking for: mail_dmarc_restore... ok
      ==> Checking for: mail_drweb_restore... ok
      ==> Checking for: mail_outgoing_restore... ok
      ==> Checking for: mail_transport_restore... ok
      Errors occured in mail restore procedure
      Some utilities have exited with errors:
      /usr/lib/plesk-9.0/mail_dk_restore
        E: server.domain.tld: key file
      /etc/domainkeys/server.domain.tld/default doesn't exist or
      not a file: No such file or directory
        Try to fix it by running: plesk repair mail

I think this is a bug and should be fixed.
 
This has been fixed in 18.0.57. You are still using 18.0.56 #4. Please upgrade.
Hello! Updated to 18.0.57#2, there is another error in this script (the problematic domain has a domain alias):
Code:
plesk repair mail subdomain.domain.tld

Repairing the mail server configuration
    Reconfiguring the settings of domains: subdomain.domain.tld ...... [2023-11-29 14:36:18.348] 418025:65673e514be2b ERR [util_exec] proc_close() failed ['/opt/psa/admin/bin/domain_repair.worker'] with exit code [1]
[FAILED]
    - domain_repair.worker failed: Fatal error:
      std::filesystem::__cxx11::filesystem_error(filesystem error:
      cannot copy: File exists [/etc/domainkeys/subdomain.domain.tld]
      [/etc/domainkeys/alias.domain.tld])
    Reconfiguring the mailboxes ..................................... [OK]
    Reconfiguring the mailboxes ..................................... [OK]

Error messages: 0; Warnings: 0; Errors resolved: 0

alias.domain.tld is an alias for subdomain.domain.tld
E-mail formats like: [email protected]
 
Oh wow, Plesk can make a subdomain an Alias? How did you manage to do that? I did not know this is possible. Could you show a screenshot of this, please? I must have missed that feature.
 
Oh wow, Plesk can make a subdomain an Alias? How did you manage to do that? I did not know this is possible. Could you show a screenshot of this, please? I must have missed that feature.
I've added the "subdomain.domain.tld" as a primary domain. So, Plesk see this domain as a full-featured domain. For this domain I've created an alias, in my example "alias.domain.tld". Why? Because this server is a mail server, with hostname "subdomain.domain.tld", but we need an SSL certificate for mail services including a valid "alias.domain.tld" certificate. Some e-mail clients connects to "subdomain.domain.tld", some connects to "alias.domain.tld", I think this is the only way to do it with Plesk. Let's Encrypt generates the SSL well, and I can select it under the global SSL settings. Sorry for the deception, in this case the domain called subdomain is a full-featured domain (subscription main domain) from Plesk's point of view. So, technically this is a simple domain with another alias, the difference is that this two is belongs to the same "parent" (registered) domain.
 
Were manual DKIM configurations done on the operating system level, so that maybe some file permissions or ownerships prevent overwriting existing files by Plesk?
 
Were manual DKIM configurations done on the operating system level, so that maybe some file permissions or ownerships prevent overwriting existing files by Plesk?
Everything, every domain, every setting is created under Plesk GUI. (The installation has Warden Anti-Spam and Anti-Virus installed, but I think it does nothing with DKIM keys / functions, it only integrates Amavis). The file permissions and owners are:

/etc/domainkeys/subdomain.domain.tld/selector - root:popuser 100640
/etc/domainkeys/alias.domain.tld/selector - root:root 100640

I've a simple, another subscription, name it "domain2.tld". Permissions:

/etc/domainkeys/domain2.tld/selector - root:popuser 100640
 
Back
Top