Roundcube Community Forum

 

Resolved - Password plugins

Started by remrem, June 26, 2009, 07:44:01 AM

Previous topic - Next topic

remrem

This Post is resolved :) thanks rosali

Hi all ;)

First, sorry for my English ... :/

I have a problem with the password plugins...
I want use it with
$rcmail_config['password_driver'] = 'sql';

But my mail password is in an other db (postfix) ...
Server: localhost  -  database: postfix  -   Table: mailbox

How I can modify the password ?


Or ... if you have a nice How to for install and config for poppassd on debian lenny with postfix and virtual mail ... ;)

Big thanks ;)

remrem

Anyone have an idea ? other plugins ?

rosali


// SQL Driver options 
// ------------------ 
// PEAR database DSN for performing the query. By default 
// Roundcube DB settings are used. 
$rcmail_config['password_db_dsn'] = 'mysql://postfix:pass@localhost/mailbox'


... assuming you are using MySQL. Also you have analyze the table structure of mailbox and to adjust ...


$rcmail_config
['password_query'] = 'UPDATE `hm_accounts` SET `accountpassword` = %c, `accountpwencryption` = '2' WHERE `accountaddress` = %u LIMIT 1;';


The example above is for hMailServer. I don't know postfix database structure. You have to adjust the query string accordingly. For available macros check the hints in the config file.
Regards,
Rosali

remrem

Hi rosali,

Big thank for your solution, I try this in few hours...

I post here if your solution resolve my problem (or no ... :( )

Rémi :)

remrem

rosali, Your solution work perfectly !

Big thank !
Now ... fire in the skins ;)

fms

Please help with password plugin.

I'm having the error: "Could not save new password."

my /usr/local/www/roundcube/plugin/password/config.inc.php
-----------------------------------------------------------
$rcmail_config['password_driver'] = 'sql';

$rcmail_config['password_db_dsn'] = 'mysql://postfix:mypass@localhost/postfix';

// I tried this too:
// $rcmail_config['password_db_dsn'] = 'mysql://postfix:mypass@unix(/tmp/mysql.sock)/postfix';

$rcmail_config['password_query'] = "UPDATE `mailbox` SET `password` = '%c', `modified` = date_format(now(),'%Y-%m-%d %H:%i:%s') WHERE `username` = '%u' LIMIT 1";
-----------------------------------------------------------
Can you see any errors on my settings?

Is there some LOG where I could watch to see if my query is being executed?

Thank you in advance for any help!
Francisco

rosali

#6
$rcmail_config['password_db_dsn'] = 'mysql://postfix:mypass@localhost/postfix';

Is the password for mysql postfix user really mypass ?

Also it should not be necessary to quote macros.
Regards,
Rosali

remrem

Hi,

`modified` = date_format(now(),'%Y-%m-%d %H:%i:%s')

remove this ! I think the password dont change because, no quote for dateformat .... ;)


N.B. My english sucks very well ... no ?

fms

#8
( it WORKED! )

Hi Rosali.

No, no, my password for mysql postfix is another one. And I verified it and it is correct, i.e. I connect using a mysql-client with my "real" password and it works. On my "real" config.inc.php, I use my "real" pass unless "mypass".

I removed:

`modified` = date_format(now(),'%Y-%m-%d %H:%i:%s')


and I removed quotes on macros %c and %u:


$rcmail_config
['password_query'] = "UPDATE `mailbox` SET `password` = %c WHERE `username` = %u LIMIT 1";

// and this way works too:

$rcmail_config['password_query'] = "UPDATE `mailbox` SET `password` = %c, modified=now() WHERE `username` = %u LIMIT 1";



(it worked!  -- let me ask: is there any LOG where I could watch and look for errors like this one?)

thank you !!!
Francisco

seanand

#9
Using postfix admin, this worked for me:

its based off of fms's


$rcmail_config
['password_query'] = "UPDATE mailbox SET password = ENCRYPT(%p), modified=now() WHERE username = %u LIMIT 1;"


Sean

blair.sawler

Hi

Has anyone gotten this to work with cpanel? Currently I have .2.2 working with [v0.2] cPanel Addon (Password, Forward & Vacation), by nemesis, but want to upgrade to .3 stable.

Looking for some guidance..... thanks!

Big Tom

I would be interested in that as well. I tried to figure it out on my own but just don't have the php skills or knowledge of how cpanel e-mail works.

Tom

sumit9451

Hello i tried this
I want use it with

$rcmail_config['password_driver'] = 'sql';

$rcmail_config['password_db_dsn'] = 'mysql://comp35_rnd02:3aRqSzgezi@localhost/com35_rnd02';

$rcmail_config['password_query'] = 'UPDATE mailbox SET password=%p WHERE username=%u AND password=%o AND domain=%d LIMIT 1';

this i get cannot save the password or sometime blank page.. pLease help

JohnDoh

are you sure you want username=%u and not username=%l? check the rc error log (rc root/logs/) for any info.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

sumit9451

Hello i am not getting any error in log,

I am getting cannot save password !

Please help me I wil be really thankful to you!