Little script provide a basic REST API to create users in the Mailu Mail Server. https://newmail.gnous.eu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Mael G. 885b4c87be Shlex securisation 1 year ago
README.md Config sample 🤖 1 year ago
app.ini Init 1 year ago
app.py Shlex securisation 1 year ago
config.sample.json Config sample 🤖 1 year ago
mailuremote.service Init 1 year ago
requirements.txt Init 1 year ago
wsgi.py Init 1 year 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 in config.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 line http:.
  • 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.