Little script provide a basic REST API to create users in the Mailu Mail Server.
https://newmail.gnous.eu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
4 years ago | |
---|---|---|
README.md | 4 years ago | |
app.ini | 4 years ago | |
app.py | 4 years ago | |
config.sample.json | 4 years ago | |
mailuremote.service | 4 years ago | |
requirements.txt | 4 years ago | |
wsgi.py | 4 years ago |
README.md
Mailu Remote
This little script provide a basic REST API to create users in the Mailu Mail Server.
He use directly the docker
command because they are no other way to do this, sorry. _(so the app need to run as root :c )
Installation :
- Mailu Remote need Python3.6+ and some Python requirements. Install them using this command :
pip3 install -r requirements.txt
- Now put the content of this git repository into your Mailu main directory (in my case
/mailu/
). - Rename
config.sample.json
inconfig.json
- Generate a token with
python3 app.py gentoken
and copy it in your clipboard. - Put the token in
config.json
. - If needed, change the port in
app.ini
at the linehttp:
. - If you use UFW or an other firewall, open the selected port (by default
8000
) - Move
mailuremote.service
in/lib/system/systemd/
. - Start the service :
systemctl start mailuremote
. - Enable it (to start it on boot) :
systemctl enable mailuremote
. - Check if all work using
curl http://127.0.0.1:8000/ping
.
Now you can create a register form using this API !
Results :
The only working endpoint is /user
usign POST METHOD.
To use this endpoint you need to send the TOKEN send in config.json
usign the header X-Api-Key
.
After that you need to post in form-data an user
and password
key (String).
-
API Code 1 : The user is succefully added.
-
API Code 9 : The user can't be added.
-
API Code 10 : The email key is not a correct String.
-
API Code 8 : A key is missing in the POST request.
LICENSE :
This project is under Public Domain.