Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
roundcube password plugin
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1029

PostPosted: Mon Nov 18, 2019 1:28 am    Post subject: roundcube password plugin Reply with quote

I tried to activate said plugin for my working mailserver which was initially setup and database created by postfixadmin

Code:
config['password_db_dsn'] = 'mysql://postfixadminuser:password@localhost/postfixadmin_database';

$config['password_query'] = 'UPDATE `mailbox` SET `password` = %c, WHERE `username` = %u';


changes done in plugins/passwort/config.inc.php.

Am I missing something?

Result: New password not be saved message when trying to change password in roundcube.
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 560
Location: Somewhere in Denmark

PostPosted: Mon Nov 18, 2019 4:05 pm    Post subject: Reply with quote

I haven't tried that plugin, but turning on logging in roundcube (/var/www/localhost/htdocs/roundcube/config/config.inc.php)
Code:
// ----------------------------------
// LOGGING/DEBUGGING
// ----------------------------------
// system error reporting, sum of: 1 = log; 4 = show
$config['debug_level'] = 5;

// log driver:  'syslog', 'stdout' or 'file'.
$config['log_driver'] = 'syslog';


and adding password to array of plugins in same file
Code:
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('userinfo','password');

Gives me this error
Quote:
PHP Error in /var/www/localhost/htdocs/roundcube/program/lib/Roundcube/rcube_plugin.php (157): Failed to load config from /var/www/localhost/htdocs/roundcube/plugins/password/config.inc.php

using the sample-config in the plugins/password dir.

I see there's a change-password USE-flag for Roundcube - you've tried emerging with that?

EDIT:
This was with roundcube-1.3.10 - found out that 1.4.0 was added to the tree and tried that (with change-password USE-flag) - now it seems to use the plugin-config - testing some more :)
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 560
Location: Somewhere in Denmark

PostPosted: Mon Nov 18, 2019 5:13 pm    Post subject: Reply with quote

I got it working for me with roundcube-1.4.0:

my plugins/password/config.inc.php
Code:
<?php
$config['password_driver'] = 'sql';
$config['password_strength_driver'] = null;
$config['password_confirm_current'] = false;
$config['password_minimum_length'] = 0;
$config['password_minimum_score'] = 0;
$config['password_log'] = false;
$config['password_login_exceptions'] = null;
$config['password_hosts'] = null;
$config['password_force_save'] = false;
$config['password_force_new_user'] = false;
$config['password_algorithm'] = 'clear';
$config['password_algorithm_prefix'] = '';
$config['password_blowfish_cost'] = 12;
$config['password_disabled'] = false;
$config['password_username_format'] = '%u';
$config['password_crypt_hash'] = 'md5';
$config['password_idn_ascii'] = false;
$config['password_hash_algorithm'] = 'sha1';
$config['password_hash_base64'] = false;
$config['password_db_dsn'] = 'mysql://[user]:[password]@localhost/[DB]';
$config['password_query'] = 'UPDATE virtual_users SET fullname=%c WHERE email=%u LIMIT 1';
Much of which is probably default/not needed (but I just started with the config.inc.php.dist file)

and added password to the plugins-array in config/config.inc.php

I just tried this on a 'dummy' table (fullname) didn't wan't it to change my password :)
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1029

PostPosted: Fri Nov 22, 2019 5:07 pm    Post subject: Reply with quote

Hi, thanks for your comments. Unfortunatelly I cant do it correctly apparently.

I took your file, modified user, password and dbname so it matches my settings that I have in postfixadmin (which had created my database after all). Also replaced fullname with password and virtual_users with mailbox in the query line.

I dont get it, as

mysql -u user -p set in config.ini.php has (write-)access to the database

Code:
MariaDB [dbname]> show tables;
+-----------------------+
| Tables_in_dbname  |
+-----------------------+
| admin                 |
| alias                 |
| alias_domain          |
| config                |
| domain                |
| domain_admins         |
| fetchmail             |
| log                   |
| mailbox               |
| quota                 |
| quota2                |
| vacation              |
| vacation_notification |
+-----------------------+
13 rows i[code]

MariaDB [dbname]> show columns from dbname.mailbox;
+------------+--------------+------+-----+---------------------+-------+
| Field      | Type         | Null | Key | Default             | Extra |
+------------+--------------+------+-----+---------------------+-------+
| username   | varchar(255) | NO   | PRI | NULL                |       |
| password   | varchar(255) | NO   |     | NULL                |       |
| name       | varchar(255) | NO   |     | NULL                |       |
| maildir    | varchar(255) | NO   |     | NULL                |       |
| quota      | bigint(20)   | NO   |     | 0                   |       |
| local_part | varchar(255) | NO   |     | NULL                |       |
| domain     | varchar(255) | NO   | MUL | NULL                |       |
| created    | datetime     | NO   |     | 2000-01-01 00:00:00 |       |
| modified   | datetime     | NO   |     | 2000-01-01 00:00:00 |       |
| active     | tinyint(1)   | NO   |     | 1                   |       |
+------------+--------------+------+-----+---------------------+-------+
10 rows in set (0.01 sec)[/code]n set (0.00 sec)


The query in the config.ini.php is:
Code:
$config['password_query'] = 'UPDATE mailbox SET password=%c WHERE email=%u LIMIT 1';

When trying to change password in roundcube plugin, the result is always the same. I just get a message in roundcube that the password was not changed :oops:

Is there any debug logging, that I could activate in order to find out whats going on?
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 560
Location: Somewhere in Denmark

PostPosted: Fri Nov 22, 2019 8:52 pm    Post subject: Reply with quote

You can try adding:
Code:
// system error reporting, sum of: 1 = log; 4 = show
$config['debug_level'] = 5;

// Log SQL queries
$config['sql_debug'] = true;

// log driver:  'syslog', 'stdout' or 'file'.
$config['log_driver'] = 'syslog';



To your roundcube/config/config.inc.php

EDIT:
How are your usernames stored in the database ie. is it johndoe@example.com or just johndoe? (would translate to %u or %l - I guess)
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1029

PostPosted: Thu Nov 28, 2019 10:47 pm    Post subject: Reply with quote

Hey Freke,

its username@domain.com :D
Back to top
View user's profile Send private message
Elleni
Veteran
Veteran


Joined: 23 May 2006
Posts: 1029

PostPosted: Mon Dec 23, 2019 9:33 pm    Post subject: Reply with quote

What would be the correct query in that case? Nothing I tried worked.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum