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.

SecurityBasicAuth
Request
query Parameters
fwdopt
required
string

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.
Enum: "fwd" "fail" "blackhole" "pipe"
Example: fwdopt=fwd
domain
string <domain>

The domain whose default email behavior you want to configure.

Note:

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

Example: domain=example.com
failmsgs
string
Default: "No such person at this address"

The failure message for the message’s sender.

Note:

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

Example: failmsgs=Failure echos loud. That address does not exist. Softly I regret. - an email failure haiku
fwdemail
string <email>

The email address to which the system forwards messages.

Note:

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

Example: fwdemail=admin@example.com
pipefwd
string

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.

Example: pipefwd=mailscript.pl
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Email/set_default_address
Request samples
uapi --output=jsonpretty \
  --user=username \
  Email \
  set_default_address \
  fwdopt='fwd'
Response samples
application/json
{
  • "apiversion": 3,
  • "func": "set_default_address",
  • "module": "Email",
  • "result": {
    • "data": [
      • {
        • "dest": "admin@example.com",
        • "domain": "example.com"
        }
      ],
    • "errors": null,
    • "messages": null,
    • "metadata": {
      • "transformed": 1
      },
    • "status": 1,
    • "warnings": null
    }
}