Symptoms
-
Mail service is disabled for a domain at Domains > example.com > Mail > Mail Settings and it is not possible to enable it through the interface, because the Activate mail service on domain button is greyed out.
-
Disabling/enabling the mail service for the domain via a command-line interface does not fix the issue:
# plesk bin mail --off example.com
# plesk bin mail --on example.com
Cause
Database inconsistency.
Resolution
-
Connect to the server via SSH (Linux) / via RDP (Windows Server).
-
On Windows Server, start a command prompt as an Administrator.
-
Create a backup of the Plesk database:
-
Plesk for Linux
# plesk db dump psa > psa.sq;
-
Plesk for Windows
C:> plesk db dump psa > C:psa.sql
-
-
Open Plesk database in MySQL:
# plesk db
-
Find ID with disabled mail service using the domain name (in the example below: domain name -example.com, ID - 167):
mysql> s> select id from DomainServices where type='mail' and dom_id=(select id from domains where name='example.com');
+----+
| id |
+----+
| 167 |
+----+ -
Change mail service status using
id
from previous step:mysql> update DomainServices set status=0 where type='mail' and id=167;
Query OK, 1 row affected (0.00 sec) - Disable and enable the mail service for the subscription at Plesk > Subscriptions > example.com > Mail > Mail Settings.