Mailu: RESTful API

Created on 12 Apr 2018  ·  14Comments  ·  Source: Mailu/Mailu

A RESTful API would allow third party applications to interact with Mailu in a defined way.

  • Creating/editing/listing domains, users, aliases etc.
  • Authentication via API token
  • Implementation as a separate, optional docker container

Colud be based on the OpenAPI-Specification
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
with Swagger and Python Flask server
https://editor.swagger.io/

backlog typfeature

Most helpful comment

Hi There,

The Mailu-Project is currently in a bit of a bind! We are short on man-power, and we need to judge if it is possible for us to put in some work on this issue.

To help with that, we are currently trying to find out which issues are actively keeping users from using Mailu, which issues have someone who want to work on them — and which issues may be less important. These a less important ones could be discarded for the time being, until the project is in a more stable and regular state once again.

In order for us to better assess this, it would be helpful if you could put a reaction on this post (use the :smiley: icon to the top-right).

  • 👍️ if you need this to be able to use Mailu. Ideally, you’d also be able to test this on your installation, and provide feedback …
  • 🎉 if you find it a nice bonus, but no deal-breaker
  • 🚀 if you want to work on it yourself!
    We want to keep this voting open for 2 weeks from now, so please help out!

All 14 comments

Completely agreed, and this has been a project since #108. Unfortunately my personal time on the project has shrunk in the past year and I have not been able to take this on.

I guess a meta thread with a roadmap would be interesting, currently my priorities are:

  • stabilize the self registration features so Mailu can be used efficiently by non profit hosting structures
  • remove dependencies to sqlite in Postfix, Dovecot and Fetchmail
  • switch to Hug or any other techno for the admin API and provide a static web UI as well as CLI tools to automate Mailu tasks.

@kaiyou, it looks like you have finished the first task. Not sure if there is more work to be done on that.

What is the best way for the community to help you with remove sqlite deps and the switch to Hug?

I have started today working on proxifying postfix map requests to the admin container. My decision is to use the TCP map and a simple asyncio proxy to either Redis or HTTP directly. If you have some opinion on the best way to go: either populate a cache from the admin container and access that cache from postfix and Dovecot, or request the admin container everytime.

Then, if Redis is the choice, my small POC will probably solve 90% of Postfix use cases. Dovecot will not need many changes since Redis is already supported. Then we'll need the code to automatically populate an up-to-date redis cache of mailboxes, aliases, and user options accessed by postfix and redis. I believe ideas and contributions are welcome on that side.

After some playing around, the issue we are going to face with redis is aliases: redis does not support wildcard keys afaik. So it might be we need to forward everything to the api after all, and use redis in the back end if we ever need caching

The part you could help with then is binding Dovecot dictionaries to an http api. It does not seem trivial without redis in the middle.

Okay, the Postfix bridging to the admin API is going pretty well, I will commit this to a dedicated branch. Disclaimer: it is not currently working properly, but will probably get there by next week.

I have switched to socketmap instead of tcp map for postfix so the architecture is simpler.

Not sure if I should maintain a specific daemon or use master.conf yet. In the meantime this works fine for aliases and email delivery works fine with no db access from postfix. I will push this today or during the week depending on my free time

Okay, the branch names feat-abstract-db now contains the current state of this work. The python script currently supports proxying read-only access from postfix and dovecot to any HTTP api. This should be enough to remove database dependency in the Dovecot and Postfix containers soon.

The Python script now fully supports forwarding maps and dicts to Postfix and Dovecot. I will let other issues aside for a bit and focus on finishing this and publishing 1.6 with multiple database backends supported asap.

This is now published as part of a separate project in https://github.com/Mailu/Podop. Next step, implementing the internal API for Postfix and Dovecot to stop depending on the SQLite. The end of the tunnel is near!

Okay, Podop is now published to Pypi ans the branch contains code for basic IMAP functionality (conmecting and browsing email work without Dovecot accessing the sqlite file at any time)

I'll move this part of the discussion to #420 and keep this open for a more business oriented api

Hi There,

The Mailu-Project is currently in a bit of a bind! We are short on man-power, and we need to judge if it is possible for us to put in some work on this issue.

To help with that, we are currently trying to find out which issues are actively keeping users from using Mailu, which issues have someone who want to work on them — and which issues may be less important. These a less important ones could be discarded for the time being, until the project is in a more stable and regular state once again.

In order for us to better assess this, it would be helpful if you could put a reaction on this post (use the :smiley: icon to the top-right).

  • 👍️ if you need this to be able to use Mailu. Ideally, you’d also be able to test this on your installation, and provide feedback …
  • 🎉 if you find it a nice bonus, but no deal-breaker
  • 🚀 if you want to work on it yourself!
    We want to keep this voting open for 2 weeks from now, so please help out!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kaiyou picture kaiyou  ·  4Comments

fabiorauber picture fabiorauber  ·  3Comments

whitef0x0 picture whitef0x0  ·  4Comments

Angedestenebres picture Angedestenebres  ·  3Comments

c-holtermann picture c-holtermann  ·  3Comments