Update cPanel account email forward destination

This function sets the destination to which the system forwards a system account's email.

Notes:

  • Usually, the system sends notices about the server's problems and activity to the root account.
  • If you do not use the suexec module, the nobody user receives bounce messages from email that CGI scripts send.

Important:

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

SecurityBasicAuth
Request
query Parameters
forward_to
required
string

The system account name or email address to which you wish to forward email.

Note:

To forward messages to multiple accounts or email addresses, use a comma-separated list.

Example: forward_to=user
user
required
string

The system account name to forward.

Example: user=root
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
get/set_user_email_forward_destination
Request samples
whmapi1 --output=jsonpretty \
  set_user_email_forward_destination \
  user='root' \
  forward_to='user'
Response samples
application/json
{
  • "metadata": {
    • "command": "set_user_email_forward_destination",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}