Article ID: 119947, created on May 9, 2014, last review on May 10, 2014

  • Applies to:
  • Plesk for Linux/Unix
  • Plesk for Windows

问题

当从控制面板创建如应用程序所有者之类的用户时会出现以下错误:

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

原因

一个订阅 psa 数据库中的一个域名的邮件服务项目丢失。

解决方案

  1. 运行 '/usr/local/psa/admin/sbin/autoinstaller' 并确保已安装所有组件。

  2. 尝试通过 CLI 为域名激活邮件服务

    /usr/local/psa/bin/domain --update domain.tld -mail_service true
    

    如果仍不能帮助解决问题,请进入第 3 点:

  3. 检查 psa 数据库看是否一致。'domain.tld' 是当触发错误时您浏览的订阅的名称。

    mysql> set @dom:='domain.tld';
    
    mysql> select * from DomainServices where dom_id in ((select id from domains where name = @dom),(select id from domains where webspace_id=(select id from domains where name = @dom)));
    +----+--------+------+--------+---------------+----------------+
    | id | dom_id | type | status | parameters_id | ipCollectionId |
    +----+--------+------+--------+---------------+----------------+
    |  1 |      1 | web  |      0 |             0 |              1 |
    |  4 |      3 | mail |      0 |             2 |              4 |
    |  5 |      3 | web  |      0 |             0 |              5 |
    +----+--------+------+--------+---------------+----------------+
    3 rows in set (0.00 sec)
    

    从上面查询结果可以看出 'id' = 1 的域名没有 'mail' 服务项。为了解决该问题请添加该项目。

    mysql> begin; insert into IpCollections value();
    Query OK, 1 row affected (0.00 sec)
    
    mysql> select * from IpCollections;
    +----+
    | id |
    +----+
    |  1 |
    |  4 |
    |  5 |
    |  6 |
    +----+
    4 rows in set (0.00 sec)
    
    mysql> select * from IP_Addresses;
    +----+---------------+---------------+-----------------+--------+--------------------+-------------------+-------+------+--------+-------------------+
    | id | serviceNodeId | ip_address    | mask            | iface  | ssl_certificate_id | default_domain_id | ftps  | main | status | public_ip_address |
    +----+---------------+---------------+-----------------+--------+--------------------+-------------------+-------+------+--------+-------------------+
    |  1 |             1 | 1.2.3.4 | 255.255.255.128 | venet0 |                  1 |                 1 | false | true |      0 | NULL              |
    +----+---------------+---------------+-----------------+--------+--------------------+-------------------+-------+------+--------+-------------------+
    1 row in set (0.00 sec)
    
    mysql> insert into IpAddressesCollections values (6,1);
    Query OK, 1 row affected (0.00 sec)
    
    mysql> select max(id) from Parameters;
    +---------+
    | max(id) |
    +---------+
    |      14 |
    +---------+
    1 row in set (0.00 sec)
    
    mysql> INSERT INTO `Parameters` VALUES (15,'mailProviderInstanceId','');
    mysql> INSERT INTO `Parameters` VALUES (15,'mailProviderType','local');
    mysql> INSERT INTO `Parameters` VALUES (15,'mailProviderUid','local');
    mysql> INSERT INTO `Parameters` VALUES (15,'nonexist_mail','reject');
    
    mysql> INSERT INTO DomainServices (dom_id,type,status,parameters_id,ipCollectionId) VALUES (1,'mail',0,15,6);
    Query OK, 1 row affected (0.03 sec)
    
    mysql> commit;
    Query OK, 0 rows affected (0.01 sec)
    
  4. 如果仍存在请手动创建 maildir

    mkdir /var/qmail/mailnames/domain.tld
    

a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c 29d1e90fd304f01e6420fbe60f66f838 85a92ca67f2200d36506862eaa6ed6b8

Email subscription for changes to this article