Symptoms
- The affected domain can only send mail via Sendmail (in other words, via a website-related script)
-
Mail service is disabled for a domain in the graphical interface at Plesk > 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 / grayed 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
Plesk database inconsistency in table entries that concern the status of the mail service for this domain.
Resolution
-
Connect to the server via SSH (Linux) / via RDP (Windows Server).
Note: On Windows Server, you would also need to start a command prompt as an Administrator.
-
Create a backup of the Plesk database:
-
Plesk for Linux
# plesk db dump psa > psa.sql
-
Plesk for Windows
C:> plesk db dump psa > C:psa.sql
-
-
Open Plesk database in MySQL:
# plesk db
-
Acquire the ID of the domain with disabled mail service by executing this query:
Note: In the example below, the domain name example.com has an ID 167
mysql> 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 the
id
number obtained in the 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 in order to make sure it is now working as expected.
Additional information
What is Sendmail? Hosting Wikipedia