Author Topic: RoundCube webmail: redirect on logout  (Read 10328 times)

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
RoundCube webmail: redirect on logout
« on: June 07, 2017, 07:39:27 AM »
Hi!

I need to configure redirection on logout for RoundCube. Mine is installed in WHM. I found out this code here https://codevote.blogspot.de/2013/07/roundcube-mail-how-to-redirect-to-url.html to add to RoundCube's index.php, but redirection to mydomain.com will not work. Is this code ok or perhaps there is a tweak that will do the redirection on logout trick?

Any advice is welcome :-)

Rgs

IM

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,628
    • http://SKaero.com/

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #2 on: June 07, 2017, 08:24:50 AM »
Thanks! Please, how do I install the plugin?


Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #4 on: June 09, 2017, 04:22:18 AM »
Many thanks.

I need help making it work. Here are the steps I took:

1. Uploaded the plugin, it is now at /plugins/logout_redirect_master
2. Added the following settings to config.inc.php:

Code: [Select]
// ----------------------------------
// PLUGINS
// ----------------------------------

// List of active plugins (in plugins/ directory)
$config['plugins'] = array('cpanellogin','cpanellogout','logout_redirect_master');

/* %d will be replaced with the default user identity email domain part
 *    i.e. email@domain.com will replace %d with "domain.com"
**/
$config['logout_redirect_url'] = 'https://www.mydomain.com/';

However, the redirection to https://www.mydomain.com is not working onlogout. It will redirected to the same cpanel login page. Should I delete 'cpanellogout' from the enabled plugin list above?
 
« Last Edit: June 09, 2017, 10:10:24 AM by itmonitor »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,628
    • http://SKaero.com/
Re: RoundCube webmail: redirect on logout
« Reply #5 on: June 09, 2017, 10:57:04 AM »
I'm not sure about the conflict with the cpanel plugin but the folder name needs to be "logout_redirect" not "logout_redirect_master"

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #6 on: June 09, 2017, 12:09:35 PM »
Thanks!

When downloading the logout_redirect plugin at https://github.com/marneu/logout_redirect , it will download a zipped file named logour_redirect-master. No problem, I renamed the plugin folder into logout_redirect and changed config.inc.php into
Code: [Select]
$config['plugins'] = array('cpanellogin','cpanellogout','logout_redirect'); but still the logout does not work.

Does this plugin needs the roundcube/plugin-installer: >=0.1.2?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,628
    • http://SKaero.com/
Re: RoundCube webmail: redirect on logout
« Reply #7 on: June 09, 2017, 12:39:32 PM »
You shouldn't need to, it maybe conflicting with the cpanel logout plugin, I'm not sure what that one does. Is there anything in the logs?

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #8 on: June 09, 2017, 12:45:22 PM »
I can check, please, where is the log and the file name?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,628
    • http://SKaero.com/
Re: RoundCube webmail: redirect on logout
« Reply #9 on: June 09, 2017, 01:36:39 PM »
There should be a errors file in the logs file.

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #10 on: June 09, 2017, 02:52:32 PM »
could not find any error log in the folders under the main folder RoundCube. Enven the folder Logs is empty. Do you know where I enable error logging?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,628
    • http://SKaero.com/
Re: RoundCube webmail: redirect on logout
« Reply #11 on: June 09, 2017, 03:25:06 PM »
That most likely means there are no errors. What is happening when you logout?

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #12 on: June 09, 2017, 11:46:34 PM »
it logouts as usual, to the Webmail login from WHM/Cpanel, instead of logging out into the https URL I specified in the code above.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,628
    • http://SKaero.com/
Re: RoundCube webmail: redirect on logout
« Reply #13 on: June 10, 2017, 12:20:55 AM »
That wouldn't be the default behavior so the "cpanellogout" logout plugin is most likely overwriting the "logout_redirect" plugin. Try removing the "cpanellogout" plugin from the plugins array and see if it works then.

Offline itmonitor

  • Jr. Member
  • **
  • Posts: 18
Re: RoundCube webmail: redirect on logout
« Reply #14 on: June 10, 2017, 01:52:17 AM »
Skaero, thank you for your patience :-)

Well, I deleted 'cpanellogut' from the array, but still the logout is not redirected to the https URL. Just to help, I reproduce the steps I took when installing the logout_redirect plugin

1. I downloaded it and when unzipped, it will result in a folder named logout_redirect-master
2. I deleted the -master part and uploaded it to the roundcube/plugins folder in the server
3. On config.inc.php I added 'logout_redirect' to end of the array as follows:
Code: [Select]
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('cpanellogin','attachment_reminder','redundant_attachments','newmail_notifier','vcard_attachments','zipdownload','logout_redirect');
4. At the end of the config.inc.php file I pasted the code:
Code: [Select]
/* %d will be replaced with the default user identity email domain part
 *    i.e. email@domain.com will replace %d with "domain.com"
**/
$config['logout_redirect_url'] = 'https://www.mydomain.com/';

5. For every code change I did, I deleted Chrome's cookies.

Are all those steps/code ok?

Wild guesses:
Perhaps the redirect will not work with https?
When doing the login: from mydomain.com's home page, I click on a hyperlink that takes me to the WHM Webmail login page. I type user id and password and access the webmail. On logout it will redirect again to the WHM Webmail page (and not to mydomain.com's home page). Perhaps on the WHM Webmail login it will add a cookie that makes it return to the same login page on logout?