Enabling/Disabling Mail Service on Domain

Use the enable (disable) operation to enable (disable) mail service on a particular site.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet that enables mail service on the specified site contains the enable operation node:

<packet>
  <mail>
    <enable>
     ...
    </enable>
  </mail>
</packet>

 

The enable node does not have a separate data type, it is nested within the MailTypeRequest type (mail_input.xsd). The enable node has the following graphics representation:

  • The site-id node is required. It indicates the site on which mail service should be turned on. Data type: integer.

 

A request XML packet that disables mail service on the specified site contains the disable operation node:

<packet>
  <mail>
    <disable>
     ...
    </disable>
  </mail>
</packet>

 

The disable node does not have a separate data type, it is nested within the MailTypeRequest complex type (mail_input.xsd). The disable node has the following graphics representation:

  • The site-id node is required. It indicates the site on which mail service should be turned off. Data type: it_type (integer).
 

Response Packet Structure

The enable node of the response packet is structured as follows:

  • The result node is optional. It wraps the result of the requested enable operation. Data type: resultType (common.xsd).
  • The status node is required. It returns the execution status of the enable operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It is used to return an error code if the enable operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return an error message if the enable operation fails. Data type: string.

 

The disable node of the response packet is structured as follows:

  • The result node is optional. It wraps the result of the requested disable operation. Data type: resultType (common.xsd).
  • The status node is required. It returns the execution status of the disable operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It is used to return an error code if the disable operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return an error message if the disable operation fails. Data type: string.
 

Samples

Enabling mail service on multiple sites

The following request packet demonstrates how mail service can be enabled on multiple sites:

<packet>
<mail>
 <enable>
   <site-id>1</site-id>
 </enable>
 <enable>
   <site-id>2</site-id>
 </enable>
 </mail>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <mail>
    <enable>
      <result>
        <status>ok</status>
      </result>
    </enable>
    <enable>
      <result>
        <status>ok</status>
      </result>
    </enable>
  </mail>
</packet>
Disabling mail service on multiple sites

To disable mail service on multiple sites, send the following request:

<packet>
<mail>
 <disable>
   <site-id>1</site-id>
 </disable>
 <disable>
   <site-id>2</site-id>
 </disable>
 </mail>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <mail>
    <disable>
      <result>
        <status>ok</status>
      </result>
    </disable>
    <disable>
      <result>
        <status>ok</status>
      </result>
    </disable>
  </mail>
</packet>
Enabling mail service on one site and disabling on another site

XML API allows the use of both these operations within a single packet and within the same mail operator:

<packet>
<mail>
 <enable>
   <site-id>1</site-id>
 </enable>
 <disable>
   <site-id>2</site-id>
 </disable>
</mail>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <mail>
    <enable>
      <result>
        <status>ok</status>
      </result>
    </enable>
    <disable>
      <result>
        <status>ok</status>
      </result>
    </disable>
  </mail>
</packet>
 

Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.