Child pages
  • WHM API 1 Functions - get_mailbox_status

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function lists the status of a cPanel's mail account's mailboxes.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledReceiveMailRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/get_mailbox_status?api.version=1&account=user@example.com



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/get_mailbox_status?api.version=1&account=user@example.com



Expand
titleCommand Line


Code Block
languagebash
whmapi1 get_mailbox_status account=user@example.com

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{ 
   "metadata":{  
      "command":"get_mailbox_status",
      "version":1,
      "result":1,
      "reason":"OK"
   },
   "data":{  
      "INBOX.marla_singer@example_com":{  
		 "guid":"1234560f0c58d158c92a000044f0d230",
         "messages":"0",
         "vsize":"0"
      },
      "INBOX.angel_face@example_com":{  
		 "guid":"11234560f0c58d158c92a000044f0d23",
         "messages":"0",
         "vsize":"0"
      },
      "INBOX.tyler_durden@example_com":{ 
		 "guid":"111234560f0c58d158c92a000044f0d2", 
         "messages":"0",
         "vsize":"0"
      },
      "INBOX.Trash":{  
		 "guid":"1111234560f0c58d158c92a000044f0d",
         "messages":"0",
         "vsize":"0"
      },
      "INBOX.narrator@example_com":{  
		 "guid":"11111234560f0c58d158c92a000044f0",
         "messages":"0",
         "vsize":"0"
      },
      "INBOX":{  
		 "guid":"111111234560f0c58d158c92a000044f",
         "vsize":"0",
         "messages":"0"
      },
      "INBOX.Sent":{  
		 "guid":"1111111234560f0c58d158c92a000004",
         "messages":"0",
         "vsize":"0"
      },
      "INBOX.Drafts":{  
		 "guid":"11111111234560f0c58d158c92a00000",
         "messages":"0",
         "vsize":"0"
      },
      "INBOX.robert_paulsen@example_com":{
		 "guid":"111111111234560f0c58d158c92a0000",  
         "messages":"0",
         "vsize":"0"
      }
   }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
	<metadata>
		<command>get_mailbox_status</command>
		<version>1</version>
		<result>1</result>
		<reason>OK</reason>
	</metadata>
	<data>
		<INBOX.marla_singer@example_com>
			<guid>1234560f0c58d158c92a000044f0d230</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.marla_singer@example_com>
		<INBOX.angel_face@example_com>
			<guid>11234560f0c58d158c92a000044f0d23</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.angel_face@example_com>
		<INBOX.tyler_durden@example_com>
			<guid>111234560f0c58d158c92a000044f0d2</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.tyler_durden@example_com>
		<INBOX.Trash>
			<guid>1111234560f0c58d158c92a000044f0d</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.Trash>
		<INBOX.narrator@example_com>
			<guid>11111234560f0c58d158c92a000044f0</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.narrator@example_com>
		<INBOX>
			<guid>111111234560f0c58d158c92a000044f</guid>
			<vsize>0</vsize>
			<messages>0</messages>
		</INBOX>
		<INBOX.Sent>
			<guid>1111111234560f0c58d158c92a000004</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.Sent>
		<INBOX.Drafts>
			<guid>11111111234560f0c58d158c92a00000</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.Drafts>
		<INBOX.robert_paulsen@example_com>
			<guid>111111111234560f0c58d158c92a0000</guid>
			<messages>0</messages>
			<vsize>0</vsize>
		</INBOX.robert_paulsen@example_com>
	</data>



Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

Parameters

ParameterTypeDescriptionPossible valuesExample
accountstring

Required

The email account's name.

  • A valid email account that exists on the server.
  • The cPanel user's account name.

    Note
    titleNote:

    _mainaccount is an alias represents the cPanel user's mailbox (For example, _mainaccount@example.com represents the example mailbox).


user@example.com

example

_mainaccount@example.com

Returns

ReturnTypeDescriptionPossible valuesExample
mailbox namehash

A hash that contains information about the mailbox's contents.

Note
titleNote:

The mailbox name is the return's name.


This hash contains the guid, messages, and vsize returns. 

guid

string

The mailbox globally unique identifier (GUID).

Note
titleNote:

We introduced this return in cPanel & WHM version 64.

The function returns this value in the mailbox name hash.
A valid alpha-numeric 32-byte GUID that the account owns.
1234560f0c58d158c92a000044f0d230

messages

integer

The total number of messages in the mailbox.

The function returns this value in the mailbox name hash.

A valid integer.0

vsize

integer

The total virtual size of the mailbox's contents, computed with CRLF line terminators.

The function returns this value in the mailbox name hash.

A valid integer that represents the virtual size of the mailbox, in bytes.0