# cPanel API 2 Functions - EmailTrack::search

Warning:
The cPanel API 2 system is deprecated. We **strongly** recommend that you use [UAPI](/cpanel/introduction) instead of cPanel API 2.

## Description

This function displays tracking information for the messages in the account's message queue.

Warning:
We **strongly** recommend that you use [UAPI](/cpanel/introduction/) instead of cPanel API 2. However, no equivalent UAPI function exists.

## Examples

WHM API (JSON)


```undefined syntaxhighlighter-pre
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=EmailTrack&cpanel_jsonapi_func=search&success=1&defer=0
```

div
Note:

For more information, read our [Calls from the WHM API](/whm/use-whm-api-to-call-cpanel-api-and-uapi) documentation.

LiveAPI PHP Class


```undefined syntaxhighlighter-pre
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Displays tracking information for email on the account.
$email_search = $cpanel->api2(
    'EmailTrack', 'search',
       array(
       'success'     => '1',
       'defer'  => '0'
    )
 );
```

div
Note:

For more information, read our [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system/#guide-to-the-liveapi-system).

LiveAPI Perl Module


```undefined syntaxhighlighter-pre
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Displays tracking information for email on the account.
my $email_search = $cpliveapi->api2(
    'EmailTrack', 'search',
    {
        'success'           => '1',
        'defer'        => '0'
    }
 );
```

div
Note:

For more information, read our [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system/#guide-to-the-liveapi-system).

cPanel Tag System (deprecated)

Warnings:
- cPanel tags are **deprecated**. We **strongly** recommend that you **only** use the [LiveAPI](/guides/guide-to-the-liveapi-system) system to call the cPanel APIs. Examples are **only** present in order to help developers move from the old cPanel tag system to our [LiveAPI](/guides/guide-to-the-liveapi-system).
  - cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
    - For more information, read our [Deprecated cPanel Tag Usage](/cpanel-api-2/cpanel-api-2-deprecate-cpanel-tag-usage/) documentation.


Command Line


```undefined syntaxhighlighter-pre
cpapi2 --user=username EmailTrack search success=1 defer=0
```

div
Notes:

- You **must** URI-encode values.
- `username` represents your account-level username.
- You **must** include the `--user=username` option.
- For more information and additional output options, read our [Guide to cPanel API 2](/cpanel-api-2/) documentation or run the `cpapi2 --help` command.
- If you run CloudLinux™, you **must** use the full path of the `cpapi2` command:

```undefined syntaxhighlighter-pre
/usr/local/cpanel/bin/cpapi2
```


Output (JSON)


```undefined syntaxhighlighter-pre
{
   "cpanelresult" : {
      "apiversion" : 2,
      "data" : [],
      "event" : {
         "result" : 1
      },
      "func" : "search",
      "metadata" : {
         "overflowed" : 0
      },
      "module" : "EmailTrack"
   }
}
```

Note:
Use cPanel's *[API Shell](https://docs.cpanel.net/cpanel/advanced/api-shell-for-cpanel)* interface (*cPanel >> Home >> Advanced >> API Shell*) to directly test cPanel API calls.

## Parameters

table
thead
tr
th
Parameter
th
Type
th
Description
th
Possible values
th
Example
tbody
tr
td
code
success
td
p
em
Boolean
td
p
span
Whether to return messages with a 
code
success
 status.
p
span
This parameter defaults to 
code
0
span
.
td
ul
li
code
1
 — Return messages with a 
code
success
 status.
li
code
0
 — Do 
strong
not
 return messages with a 
code
success
 status.
td
div
p
code
1
tr
td
code
defer
td
p
em
Boolean
p
br
td
p
Whether to return messages with a 
code
defer
 status.
p
This parameter defaults to 
code
0
.
td
ul
li
code
1
 — Return messages with a 
code
defer
 status.
li
code
0
 — Do 
strong
not
 return messages with a 
code
defer
 status.
td
code
0
## Returns

table
thead
tr
th
strong
strong
Return
th
strong
Type
th
strong
Description
th
strong
Possible values
th
strong
Example
tbody
tr
td
code
transport
td
em
string
td
The mail transfer agent (MTA)
td
A valid cPanel-supported MTA.
td
code
Exim
tr
td
code
ip
td
em
string
td
The recipient's IP address.
td
A valid IP address.
td
code
192.168.0.1
tr
td
code
transport_is_remote
td
em
Boolean
td
Whether the MTA was remote.
td
ul
li
code
1
 — Remote.
li
code
0
 — 
strong
Not
 remote.
td
code
0
tr
td
code
deliveredto
td
em
string
td
The delivery attempt's final destination.
td
A valid email address.
td
code
user@example.com
tr
td
code
size
td
em
integer
td
The size of the message, in bytes.
td
A positive integer that represents the size of the messages, measured in bytes..
td
code
12345
tr
td
code
deliveryuser
td
em
string
td
The user that delivered the mail.
td
A valid username.
td
code
postmaster
tr
td
code
sendunixtime
td
em
string
td
The message's send time.
td
A valid timestamp, in 
a
Unix time
 format.
td
code
1415392926
tr
td
code
senderhost
td
em
string
td
The sender's hostname.
td
A valid hostname.
td
code
hostname.example.com
tr
td
code
domain
td
em
string
td
The sender's domain name.
td
A valid domain name.
td
code
example.com
tr
td
code
actionunixtime
td
em
string
td
The time of the delivery attempt.
td
span
A valid timestamp, in 
a
Unix time
 format.
td
code
1415392926
tr
td
code
msgid
td
em
string
td
The message ID.
td
A valid string.
td
code
This is a message id
tr
td
code
user
td
em
string
td
The sender's username.
td
A valid username.
td
code
sender
tr
td
code
recipient
td
em
string
td
The recipient's email address.
td
A valid email address.
td
code
user@example.com
tr
td
code
actiontime
td
em
string
td
The time that the delivery attempt occurred, in human-readable format.
td
p
A valid timestamp, in 
code
YYYY-DD-MM HH:MM:SS
 format, where:
ul
li
code
YYYY
 represents the year.
li
code
DD
 represents the day.
li
code
MM
 represents the month.
li
code
HH
 represents the hour.
li
code
MM
 represents the minute.
li
code
SS
 represents the second.
td
code
2014-02-06 14:17:51
tr
td
code
deliverydomain
td
em
string
td
The recipient's domain.
td
A valid domain name.
td
code
example.com
tr
td
code
host
td
em
string
td
The hostname that received the message.
td
A valid hostname.
td
code
hostname.example.com
tr
td
code
router
td
em
string
td
p
The method that the system uses to deliver mail to the specified address.
td
p
code
lookuphost
 is the 
strong
only
 possible value.
td
code
lookuphost
tr
td
code
message
td
em
string
td
The action that the mail server executed.
td
A valid string.
td
code
Domain example.com has exceeded the max defers and failures per hour (5/5 (100%)) allowed. Message discarded).
tr
td
code
senderauth
td
em
string
td
The user's authentication method.
td
A valid authentication method.
td
code
DKIM
tr
td
code
sender
td
em
string
td
The sender's full email address.
td
A valid email address.
td
code
sender@example.com
tr
td
code
spamscore
td
em
integer
td
The message's 
a
 Apache SpamAssassin
™ score.
td
A positive integer.
td
code
1
tr
td
code
senderip
td
em
string
td
The sender's IP address.
td
A valid IP address.
td
code
192.168.0.2
tr
td
code
type
td
em
string
td
The delivery status.
td
ul
li
code
success
li
code
defer
li
code
failure
li
code
inprogress
td
code
success
tr
td
code
reason
td
em
string
td
p
A reason for failure.
p
This function 
strong
only
 returns a 
code
reason
 value if it failed.
td
p
A string that describes the error.
td
code
This is an error message.
tr
td
code
result
td
em
Boolean
td
p
Whether the function succeeded.
td
ul
li
code
1
 — The function succeeded.
li
code
0
 — The function failed.
td
code
1