From b58fb54725ce75c70a8e7e7f81a70fbae840cfb9 Mon Sep 17 00:00:00 2001 From: schlypel Date: Wed, 29 Jun 2016 13:34:54 +0200 Subject: [PATCH 1/2] added API info to aliases page template --- management/templates/aliases.html | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/management/templates/aliases.html b/management/templates/aliases.html index dc916f95..d5a123ff 100644 --- a/management/templates/aliases.html +++ b/management/templates/aliases.html @@ -106,6 +106,40 @@ +

Mail alias API

+ +

Use your box’s Mail alias API to add/remove aliases.

+ +

Usage:

+ +
curl -X VERB [-d "value"] --user {email}:{password} https://{{hostname}}/admin/mail/aliases[action]
+ +

(Brackets denote an optional argument.)

+

(Adding ?format=json will give json encoded results)

+ +

Verbs

+ + + + + + +
Verb Action
GET Returns a list of existing mail aliases.
POST/add Adds a new mail alias. Required parameters are address and forward_to.
POST/remove Removes a mail alias. Required parameter is address.
+ +

Examples:

+ +

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 users
+curl -X GET https://{{hostname}}/admin/mail/users?format=json
+
+# adds a new email alias
+curl -X POST -d "address=new_alias@mydomail.com" -d "forward_to=my_email@mydomain.com" https://{{hostname}}/admin/mail/aliases/add
+
+# removes a email alias
+curl -X POST -d "address=new_alias@mydomail.com" https://{{hostname}}/admin/mail/aliases/remove
+
+