v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
Email
Email Accounts

Create default email address

This function configures a default (catchall) email address.

Important:

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

get/Email/set_default_address

Query parameters

fwdopt'fwd' | 'fail' | 'blackhole' | 'pipe' required
Example:fwd

The method to use to handle unroutable mail.

  • fwd — Forward messages to the fwdemail parameter’s address.
  • fail — Bounce messages back to the sender, and include the failmsgs parameter’s failure message.
  • blackhole — Send messages to the /dev/null/ directory. This method does not generate a failure notice.
  • pipe — Pipe mail to the pipefwd parameter’s application. This parameter requires the File Storage role.
domainstring domain
Example:example.com

The domain whose default email behavior you want to configure.

Note:

This parameter defaults to the cPanel account’s main domain.

failmsgsstring
Example:Failure echos loud. That address does not exist. Softly I regret. - an email failure haiku

The failure message for the message’s sender.

Note:

Use this parameter if you used the fail method for the fwdopt parameter.

fwdemailstring email
Example:admin@example.com

The email address to which the system forwards messages.

Note:

Use this parameter if you used the fwd method for the fwdopt parameter.

pipefwdstring
Example:mailscript.pl

The application to which the system pipes messages.

Note:

Use this parameter if you used the pipe method for the fwdopt parameter.

Important:

This parameter requires the File Storage role.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "set_default_address",
  "module": "Email",
  "result": {
    "data": [
      {
        "dest": "admin@example.com",
        "domain": "example.com"
      }
    ],
    "metadata": {
      "transformed": 1
    },
    "status": 1
  }
}