Unable to obtain mail information for domain using API request: Internal Server Error

Created:

2016-11-16 12:53:14 UTC

Modified:

2017-04-24 12:08:37 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to obtain mail information for domain using API request: Internal Server Error

Applicable to:

  • Plesk 11.0 for Linux

Symptoms

The following output is shown while trying to get mailboxes information for domain using API request:

 [empty body]
HTTP/1.1 500 Internal Server Error

The following XML API request is used:

 <?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.5">
<mail>
<get_info>
<filter>
<site-id>111</site-id>
</filter>
</get_info>
</mail>
</packet>

where '111' is the domain's id.

Cause

The following error is caused by database inconsistency. The record in psa.accounts is missing for this mailbox.

Resolution

  1. Find missing record for specified domain:

      mysql> select id, mail_name, account_id from mail where account_id not in (select id from accounts) and dom_id=111;
    +----+-----------+------------+
    | id | mail_name | account_id |
    +----+-----------+------------+
    | 1 | noreply | 10 |
    +----+-----------+------------+
    1 row in set (0.00 sec)
  2. Insert missing record using account_id :

    mysql> insert into accounts values (10, 'plain', 'password');
  3. Change the password for this mailbox using Plesk UI.

To check which mailboxes do not have related records in accounts table, use the following query:

mysql> select d.name as 'domain name', m.mail_name as 'mail name', m.account_id as 'account id' from domains d left join mail m on d.id=m.dom_id where account_id not in (select id from accounts);
+-------------+-----------+------------+
| domain name | mail name | account id |
+-------------+-----------+------------+
| example.com | info | 11 |
| domain.tld | test | 22 |
+-------------+-----------+------------+
2 rows in set (0.00 sec)
Have more questions? Submit a request
Please sign in to leave a comment.