Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for custom login/logout url #278

Closed
Diman0 opened this issue Mar 9, 2022 · 5 comments
Closed

Support for custom login/logout url #278

Diman0 opened this issue Mar 9, 2022 · 5 comments

Comments

@Diman0
Copy link

Diman0 commented Mar 9, 2022

I'm looking into migrating from Rainloop to SnappyMail.

Currently we use Rainloop with sso. It is documented here
https://github.com/RainLoop/rainloop-webmail/wiki/SSO-example

In Applications.ini we set a custom login and logout link
https://github.com/Mailu/Mailu/blob/fe7397bedf2dd3d611f9f2837a1253133aa0b4f2/webmails/rainloop/defaults/application.ini#L11

custom_login_link='sso.php'
custom_logout_link='/sso/logout'

This functionality appears to be missing in SnappyMail. I could not locate it in https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php. Is there an alternative for this in Snappymail?

I already found out that GetUserSsoHash is renamed to CreateUserSsoHash in SnappyMail. This functionality works as expected. I only miss how to configure a custom login/logout page in SnappyMail.

@the-djmaze
Copy link
Owner

Solved. Also the example should be different. Like:

<?php

// Enable SnappyMail Api and include index file
$_ENV['SNAPPYMAIL_INCLUDE_AS_API'] = true;
require 'index.php';

//
// Get sso hash
//
// @param string $email
// @param string $password
// @return string
//
$ssoHash = \RainLoop\Api::CreateUserSsoHash('user@yourdomain.com', 'password');

// redirect to webmail sso url
\header('Location: https://yourdomain.com/?sso&hash='.$ssoHash);

@the-djmaze
Copy link
Owner

P.S. Why the change?
Mailu/Mailu#1796 (comment) was closed after i made several attempts to integrate it (but i failed).

@the-djmaze the-djmaze reopened this Mar 9, 2022
@Diman0
Copy link
Author

Diman0 commented Mar 9, 2022

Thank you for addressing this quickly.

Due to maintenance overhead we only wanted 2 webmails at maximum. That was the main reason for not accepting the PR. Mailu is a very small project.
Recently it came to light (at least for us), that Rainloop has multiple security related bugs that have not been fixed for a long time. For this reason we are replacing Rainloop with something else.

SnappyMail is more focused on addressing security issues. It is also very similar to Rainloop. For this reason we are looking into replacing Rainloop with SnappyMail.

@the-djmaze
Copy link
Owner

Recently it came to light (at least for us), that Rainloop has multiple security related bugs that have not been fixed for a long time.

I understand. That's why i forked RainLoop.

SnappyMail is more focused on addressing security issues. It is also very similar to Rainloop. For this reason we are looking into replacing Rainloop with SnappyMail.

I understand, but under the hood a lot is changing (and not only security).
So if you have more issues or questions, just create a new issue.

For now you can test this issue in v2.13.4
https://github.com/the-djmaze/snappymail/releases/tag/v2.13.4

@Diman0
Copy link
Author

Diman0 commented Mar 12, 2022

It is working brilliantly! I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants