Modifying Mail Account Settings

Mail account settings can be modified either by Plesk Administrator or by Plesk customer. These settings are as follows:

 

The update operation is presented by three sub-operations: add, remove, and set. All these sub-operations were designed for working with the lists of objects kept in mail accounts.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet updating mail account settings includes the update operation node:

<packet>
 <mail>
  <update>
   ...
  </update>
 </mail>
</packet>

 

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

The update operation breaks into three types of update:

Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.

 

Response Packet Structure

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

 

Samples

Adding new mail account settings

The following packet updates a mail account as follows: New email addresses are added to receive webmaster correspondence.

<packet>
<mail>
<update>
   <add>
      <filter>
          <site-id>1</site-id>
          <mailname>
              <name>admin11</name>
              <forwarding>
                 <address>bob@advent.co.uk</address>
                 <address>ann@advent.co.uk</address>
                 <address>nick@advent.co.uk</address>
              </forwarding>
          </mailname>
      </filter>
   </add>
</update>
</mail>
</packet>

Response:


<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.7.0">
  <mail>
    <update>
      <add>
        <result>
          <status>ok</status>
          <mailname>
            <name>admin11</name>
          </mailname>
        </result>
      </add>
    </update>
  </mail>
</packet>
Removing mail account settings

The following packet removes several email forwarding addresses:

<packet>
<mail>
<update>
   <remove>
      <filter>
          <site-id>12</site-id>
          <mailname>
              <name>webmaster</name>
              <forwarding>
                 <address>bob@advent.co.uk</address>
                 <address>ann@advent.co.uk</address>
                 <address>nick@advent.co.uk</address>
              </forwarding>
          </mailname>
      </filter>
   </remove>
</update>
</mail>
</packet>
Setting new mail account settings

The following packet changes password to the admin mail account and saves it in a hashed form:

<packet>
<mail>
<update>
   <set>
      <filter>
          <site-id>1</site-id>
          <mailname>
              <name>contact</name>
<password>
   <value>pass123456</value>
   <type>crypt</type>
</password>
          </mailname>
      </filter>
   </set>
</update>
</mail>
</packet>

Note: This request works on Linux only, as the 'crypt' password type is not supported on Windows.

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.8.0">
  <mail>
    <update>
      <set>
        <result>
          <status>ok</status>
          <mailname>
            <name>contact</name>
          </mailname>
        </result>
      </set>
    </update>
  </mail>
</packet>