Plesk

Error while changing mail settings in Plesk: There is no mail service for domain with id = 1

Symptoms

When creating a user or changing mail settings in Plesk, the following error is encountered:

There is no mail service for domain with id = 1. It must be created before call update


Error: There is no DSMail service for domain with id = 1

Cause

The Mail service entry is missing in the psa database for one of the domains due to a database inconsistency or missing mail service

Resolution

For Linux

  1. Log into Plesk.

  2. Open Tools&Settings > Updates and Upgrades to make sure that all components were installed, including mail server. Make sure that mail service is enabled in Tools&Settings > Mail Server Settings:

    Note: even if mail service is enabled, disable it and enable again.

  3. Connect to the server via SSH.

  4. Activate the Mail service for the domain via CLI in order to re-generate the correct entries in the database.

    • Single domain:

      # plesk bin domain --update example.com -mail_service true

    • All the domains:

      # plesk db -Ne "select name from domains" | xargs -i plesk bin domain -u {} -mail_service true 2>/dev/null

For Windows

  1. Log into Plesk.

  2. Open Tools & Settings > Updates and Upgrades to make sure that all components were installed, including mail server. Make sure that mail service is enabled in Tools&Settings > Mail Server Settings:

    Note: even if mail service is enabled, disable it and enable again.

  3. Connect to the server via RDP.

  4. Activate the Mail service for the domain via CLI in order to re-generate the correct entries in the database.

    • Single domain:

      C:> plesk bin mailĀ  --update-service example.com -status enabled

    • All the domains:

      Download, unpack and run the script from the attachment.