Possibility for an App to extend user management?


as a little project for his internship I helped our intern to create a Zarafa app for YunoHost. The current state of the app is functional and sso is working as well. The last thing missing before opening it to a wider audience would be incoming email.

The most simple case would be a static transport map (e.g. add
transport_maps = hash:/etc/postfix/zarafa-transport to main.cf and have the admin manually enter users in a format like my-user@my-domain.org lmtp:, but having the ability to manage this in the regular interface would be way more appealing.

Do you already have some mechanics for this in place?

The current state can be found at: https://github.com/davidba123/zarafa_ynh

PS: writing about this, one way would also be to store this in the app settings. Can these be modified from the admin interface?

Not possible, I guess?

Hi, as this is quite a technical question, perhaps you could try submitting it to the app mailing list we’re trying to reanimate? http://list.yunohost.org/cgi-bin/mailman/listinfo

Sorry about the lack of response… hope you’ll find more there

Sorry it seems that nobody answered there either… I guess the question might be too specific.
If you manage to solve this by yourself, perhaps it will help others in the future

@ljf started a subscribe app which give some routes added to API to be able to offer a subscription page on the YunoHost instance.

However, currently, it’s not possible to add module to the web admin, there is an old PR (never finished).

I have open an issue about that.

Hi, thanks for your replies. In that case I added the manual steps to setup the transport to the readme of the repository.

OK now I see what you want to do (although I don’t know about postfix)

In the install script, loop through all users and add the corresponding line to the/etc/postfix/transport file
We’ve done a similar thing in the Rainloop app for domains: https://github.com/YunoHostPlugins-Testing/rainloop_ynh/blob/master/scripts/install#L92-L96
The code needs to be adapted for users loop. I had something coded for that but I cannot find it at the moment…
I think it was with this ldap search. If you have a testing YunoHostm perhaps withyunohost user list --output-as plain then loop
Finally, run sudo postmap /etc/postfix/transport in the install script

In your app, create a “hooks” folder like https://github.com/Kloadut/owncloud_ynh/tree/master/hooks
You need post_user_create and post_user_delete
The hook will add/remove the line of the user and update your postmap

Does it make sense?

Hi @scith,

yes that could be an idea. My initial thought was to have it user configurable, so that you could use Dovecot and Zarafa side by side. But creating the transport map in the install script would indeed be easier for the user.
Lets see, if someone is interested in using this app, maybe I could add a plugin inside of Zarafa to manage the transport map.

I think what could be done then is an option in the manifest to activate this feature or not. If the option is selected, it is activated for all users in the install script. It is a standard approach in apps