Roundcube Community Forum

 

Recent posts

#1
Release Discussion / Re: Re-login to Roundcube with...
Last post by beerzone - Today at 12:03:03 AM
SKaero, you're great! Thank you so much for your help!
Here is my final autologon plugin:
<?php

/**
 * Sample plugin to try out some hooks.
 * This performs an automatic login if accessed from localhost
 *
 * @license GNU GPLv3+
 * @author Thomas Bruederli
 */

class autologon extends rcube_plugin
{
    public function 
init()
    {
        
$this->add_hook('startup', [$this'startup']);
        
$this->add_hook('authenticate', [$this'authenticate']);
        
$this->add_hook('ready', [$this'ready']);
    }

    function 
startup($args)
    {
        if (empty(
$_SESSION['user_id']) && !empty($_GET['_autologin'])) {
            
$args['action'] = 'login';
        }
        return 
$args;
    }

    function 
ready($args)
    {
        if (!empty(
$_GET['_autologin']) && $_GET['_user'] != $_SESSION['username']){
            
$rcmail rcmail::get_instance();
            
$rcmail->logout_actions();
            
$rcmail->kill_session();
            
header("Location: https://" gethostname() . "/?_autologin=1&_user={$_GET['_user']}&_token={$_GET['_token']}");
        }
        return 
$args;
    }

    function 
authenticate($args)
    {
        if (!empty(
$_GET['_autologin'])){
            
$args['user']        = $_GET['_user'];
            
$cmd '/usr/bin/python3 /usr/share/mpd/maila/manage.py user decode -u '.$_GET['_user'].' -t '.$_GET['_token'];
            
$output shell_exec(escapeshellcmd($cmd));
            if (!empty(
$output)){
                
$out trim($output);
            }
            else {
                return 
$args;
            }
            
$args['pass']        = $out;
            
$args['host']        = 'localhost';
            
$args['cookiecheck'] = false;
            
$args['valid']       = true;
        }
        return 
$args;
    }
}
It works like a charm.
#2
Release Discussion / Re: Re-login to Roundcube with...
Last post by SKaero - April 29, 2025, 04:34:24 PM
I would use a header redirect that way the login can be handled by the other part of the plugin that is already working.
#3
Release Discussion / Re: Re-login to Roundcube with...
Last post by beerzone - April 29, 2025, 03:55:58 PM
I don't understand, how to redirect back to the login.
Now my ready function is like this:
    function ready($args)
    {
        if (!empty($_GET['_autologin'])){
            if ($_GET['_user'] != $args['user']){
                $rcmail = rcmail::get_instance();
                $rcmail->logout_actions();
                $rcmail->kill_session();
                $this->authenticate($args);
            }
        }
        return $args;
    }
If I send GET request with autologin parameter first time, the users mailbox is opened. Then I send GET request with new user. Login page with new username and empty password is opend. When I send GET request with new user again, the new users mailbox is opend.
I've tried to use $rcmail->login("new_user*master_user", "master_password", "localhost", false); instead of $this->authenticate($args);. New user mailbox is opend for a second and then redirects to empty login page.
How to redirect back to the login from the ready function correctly?
#4
Release Discussion / Re: Re-login to Roundcube with...
Last post by SKaero - April 29, 2025, 12:02:12 PM
There is an example of how to log a user out in the autologout plugin https://github.com/roundcube/roundcubemail/blob/master/plugins/autologout/autologout.php you can then redirect to the login again to login with the new account.
#5
Release Discussion / Re: Re-login to Roundcube with...
Last post by beerzone - April 29, 2025, 09:00:08 AM
How should I logout correctly?
    function ready($args)
    {
        if (!empty($_GET['_autologin'])){
            rcube::console("Logout");
            $task = 'logout'; // What code must be here?
        }
        return $args;
    }
#6
Roundcube Discussion / Re: [SOLVED] Keycloak and Roun...
Last post by jellydrink - April 29, 2025, 04:27:35 AM
sorry if I`m out of topic.

Is your Dovecot configuration compatible with authentication via the Thunderbird mail client?
#7
Roundcube Discussion / Re: Limited Password length
Last post by aconti - April 28, 2025, 02:14:50 PM
its a postfix mail server with mariadb, Dovecot and fronted by Roundcube

So need to find out who is responsable for the authentication (thought it was Dovecot) and confirm old hash method being used and find instructions to change that. Sounds right?

#8
Roundcube Discussion / Re: Can't change view
Last post by culinanrr1 - April 28, 2025, 07:15:40 AM
Hey,

I still have this issue. Did someone manage to resolve it? I only use it on webmail. Do you have any other recommendations?

Thank you!!
#9
Older Versions / Re: "Archive" folder function?
Last post by SKaero - April 25, 2025, 10:41:09 AM
Roundcube doesn't move or filter email that is likely being done either by filtering software on the mail server or as you mentioned another mail client that is connected to the mail server.
#10
Older Versions / "Archive" folder function?
Last post by tuzka - April 25, 2025, 10:18:21 AM
Hi all, please help!
We have some issue: A lot of messages - even new messages - are being moved to the Archive folder by themselves. This is unwanted behavior. We don't know if we have enabled it somewhere and we don't know how.  Or another mail client is doing it. We would need to find out exactly how Roundcube should behave. Our provider has the old Roundcube Webmail 1.1.5.

I can't find some end-user manual or information, what should "Archive" folder do.

Thank You!