Getting Mail Account Settings

Plesk Administrator can get settings of any mail account registered on any site. Plesk customers are allowed to get settings of mail accounts registered on their own sites only. The settings are as follows:

  • Mail account identifier, name, and alias
  • Control panel access settings
  • Mail box settings
  • Automatic responses, redirects, stored files
  • Mail group settings
  • Mail user permissions

Use the get_info operation to retrieve site settings.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet getting a collection of mail account settings should include the get_info operation node:

<packet>
 <mail>
  <get_info>
   ...
  </get_info>
 </mail>
</packet>

 

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

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It holds a collection of data describing which mail account settings to retrieve. Data type: GetInfoAdvancedFilter (mail_input.xsd).
  • The site-id node is required. It specifies the identifier of the site which mail accounts are requested. Data type: integer.
  • The mailbox node is optional. It indicates that mail box settings of the specified mail account are requested. Data type: none.
  • The mailbox-usage node is optional. If it is present in the request packet, the amount of disk space used by a specific mailbox will be retrieved in the response packet. Data type: none.
  • The forwarding node is optional. It indicates that the list of redirects of the specified mail account is requested. Data type: none.
  • The aliases node is optional. It indicates that the list of aliases of the given mail account is requested. Data type: none.
  • The autoresponder node is optional. It indicates that the list of automatic-response objects of the given mail account is requested. Data type: none.

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

 

Response Packet Structure

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

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is optional. It wraps the result of the requested get_info operation. It can be missing if some error occurs before the validation starts. Data type: resultType (common.xsd).
  • The status node is required. It returns the execution status of the get_info operation. Data type: string. Allowed values: ok | error.
  • The errcode node is optional. It is used to return the error code if the get_info operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return an error message if the get_info operation fails. Data type: string.
  • The mailname node is required if the get_info operation succeeds. It contains a collection of mail account settings ordered in the request packet. Data type: mailnameUpdateType (plesk_mailname.xsd). See the structure of this node in the Mail Account Settings section.
 

Samples

To request information on mail accounts looks as follows:

<packet version="1.6.3.0">
<mail>
<get_info>
   <filter>
      <site-id>1</site-id>
   </filter>
   <mailbox/>
</get_info>
</mail>
</packet>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.0">
  <mail>
    <get_info>
      <result>
        <status>ok</status>
        <mailname>
          <id>1</id>
          <name>admin</name>
          <mailbox>
            <enabled>true</enabled>
            <quota>-1</quota>
          </mailbox>
          <password/>
          <antivir>off</antivir>
        </mailname>
      </result>
      <result>
        <status>ok</status>
        <mailname>
          <id>2</id>
          <name>techdept</name>
          <mailbox>
            <enabled>true</enabled>
            <quota>1024000</quota>
          </mailbox>
          <password/>
          <antivir>inout</antivir>
        </mailname>
      </result>
      <result>
        <status>ok</status>
        <mailname>
          <id>3</id>
          <name>techdept1</name>
          <mailbox>
            <enabled>false</enabled>
            <quota>-1</quota>
          </mailbox>
          <password/>
          <antivir>off</antivir>
        </mailname>
      </result>
      <result>
        <status>ok</status>
        <mailname>
          <id>4</id>
          <name>admin1</name>
          <mailbox>
            <enabled>false</enabled>
            <quota>-1</quota>
          </mailbox>
          <password/>
          <antivir>inout</antivir>
        </mailname>
      </result>
      <result>
        <status>ok</status>
        <mailname>
          <id>5</id>
          <name>techdept11</name>
          <mailbox>
            <enabled>false</enabled>
            <quota>-1</quota>
          </mailbox>
          <password/>
          <antivir>off</antivir>
        </mailname>
      </result>
      <result>
        <status>ok</status>
        <mailname>
          <id>6</id>
          <name>admin11</name>
          <mailbox>
            <enabled>false</enabled>
            <quota>-1</quota>
          </mailbox>
          <password/>
          <antivir>inout</antivir>
        </mailname>
      </result>
    </get_info>
  </mail>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.