Aliases are email forwarders. An alias can forward email to a mail user or to any email address.
To use an alias or any address besides your own login username in outbound mail, the sending user must be included as a permitted sender for the alias.
Alias |
Forwards To | Permitted Senders |
---|
hostmaster@, postmaster@, admin@ and abuse@ email addresses are required on some domains.
Use your box’s mail aliases API to add and remove mail aliases from the command-line or custom services you build.
Usage:
curl -X VERB [-d "parameters"] --user {email}:{password} https://{{hostname}}/admin/mail/aliases[action]
Brackets denote an optional argument. Please note that the POST body parameters
must be URL-encoded.
The email and password given to the --user
option must be an administrative user on this system.
Verb | Action | |
---|---|---|
GET | (none) | Returns a list of existing mail aliases. Adding ?format=json to the URL will give JSON-encoded results. |
POST | /add | Adds a new mail alias. Required POST-body parameters are address and forwards_to . |
POST | /remove | Removes a mail alias. Required POST-body parameter is address . |
Try these examples. For simplicity the examples omit the --user me@mydomain.com:yourpassword
command line argument which you must fill in with your email address and password.
# Gives a JSON-encoded list of all mail aliases curl -X GET https://{{hostname}}/admin/mail/aliases?format=json # Adds a new alias curl -X POST -d "address=new_alias@mydomail.com" -d "forwards_to=my_email@mydomain.com" https://{{hostname}}/admin/mail/aliases/add # Removes an alias curl -X POST -d "address=new_alias@mydomail.com" https://{{hostname}}/admin/mail/aliases/remove