Plesk

Unable to swap domain and domain alias names: boost::filesystem::filesystem_error Directory not empty

Symptoms

Cause

Mail directory for the alias is not empty.

Resolution

In order to archive the goal to swap domain and domain alias names remove incorrect folder for alias:

  1. Connect to the server via SSH.

    Note: Let's assume that domain-example.com is a domain name and alias-example.com is an alias.

  2. Move current mailnames folder for alias to another directory as a backup:

    # mv /var/qmail/mailnames/alias-example.com/ ~/alias-example.com/

  3. If /var/qmail/mailnames/domain-example.com does not exist, copy backed up mail directory:

    # mkdir /var/qmail/mailnames/domain-example.com
    # cp -p ~/alias-example.com/* /var/qmail/mailnames/domain-example.com/

  4. Rename the domain.

Additional information

Unable to rename a domain: mailmng-outgoing failed: ERROR:outgoing:No backend DB entries were modified