# Add email address to BoxTrapper allowed senders

This function whitelists email messages.

Important:

When you disable the Receive Mail role, the system disables this function.

Note:

To retrieve email messages in the BoxTrapper queue from senders that you did not previously whitelist, use the UAPI BoxTrapper::deliver_messages function.

Endpoint: GET /BoxTrapper/whitelist_messages
Version: 11.136.0.25
Security: BasicAuth

## Query parameters:

  - `queuefile` (string, required)
    The filename of the email message to whitelist.

Note:

To get a list of filenames in an account's BoxTrapper queue, use the UAPI BoxTrapper::list_queued_messages function.

Note:

To whitelist multiple email messages, duplicate this parameter.
    Example: "example.msg"

  - `email` (string)
    The cPanel account email address for which to whitelist messages.

Warning

If you call this function in Webmail, the system ignores this parameter and defaults to the currently-authenticated email address.
    Example: "user@example.com"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "whitelist_messages"

  - `module` (string)
    The name of the module called.
    Example: "BoxTrapper"

  - `result` (object)

  - `result.data` (array)
    An array of one or more objects, depending on how many queuefiles were passed as parameters. Each object contains information about the whitelisted email message.
    Example: [{"email":"user@example.com","matches":["example.msg"],"operator":"whitelist"}]

  - `result.data.email` (string)
    A whitelisted email address.
    Example: "user@example.com"

  - `result.data.failed` (string)
    The system failed to whitelist the message.

* 1 — The function failed to whitelist the message. This is the only possible value.

Note:

The function only returns this property if it failed to whitelist the message.
    Enum: "1"

  - `result.data.matches` (array)
    An array of message files that the system whitelisted.

Note:

The function only returns this value if it whitelists the message.
    Example: ["example.msg"]

  - `result.data.operator` (string)
    The action that the system performed.
    Enum: "whitelist"

  - `result.data.reason` (string)
    The reason the function skipped the message during whitelisting. The reason property is returned only if the function failed to whitelist the message.
    Example: "The cPanel user, \"user\" does not own the requested account \"user@example.com.\""

  - `result.data.warning` (integer)
    Whether the system experienced issues when it whitelisted the message.

* 1 — There was an issue whitelisting the message. This is the only possible value.

Note:

The function only returns this property if it failed to whitelist the message.
    Enum: 1

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 - Success
* 0 - Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running an API.


