Current time: 04-20-2024, 09:42 PM Hello There, Guest! (LoginRegister)


Post Reply 
webmail client change pass
Author Message
deptrai Offline
Newbie
*

Posts: 9
Joined: Jun 2007
Reputation: 0
Post: #1
webmail client change pass
I've installed Squirrelmail plugin: Change SQL Password.
Mail_pass value in database is change when i excute the plugin but mail account still need the old password to log in.
It seems ispcp stores mail pass in files or some others.
Please help me fix this problem.
Thank in advanced.
09-29-2007 10:43 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #2
RE: webmail client change pass
ispcp stores th password in the table "mail_users".
*But* the imap server does not look them up in the database - courier gets the user information from /etc/courier/user* (several files).
They are managed through the engine files of ispcp.
I think it's enough, if you set the status-files to "change" and execute the request manager (there is a php funtion for this).

Hope this helps.
/Joximu
09-29-2007 05:28 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #3
RE: webmail client change pass
So you mean that ispCP writes the files for courier new !?
Ok - that could be.
But this means also that you must set the "change" & the new Password in the DB and run the request manager directly after that. Right ?

Greez BeNe
09-29-2007 07:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esni Offline
Junior Member
*

Posts: 45
Joined: Mar 2007
Reputation: 0
Post: #4
RE: webmail client change pass
I have got a password changer to work for the mail users at vhcs so it must work with ispcp, too. I have used the mscgeek.com's password changer which works fantasicly, you might want to check that out.
09-29-2007 07:13 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #5
RE: webmail client change pass
BeNe Wrote:So you mean that ispCP writes the files for courier new !?
Ok - that could be.
But this means also that you must set the "change" & the new Password in the DB and run the request manager directly after that. Right ?

Greez BeNe

yes - by updateing the database/table with the new password you should set the status and after this you should call the function "send_request()" (from ispcp-function.php).

/J
09-29-2007 07:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #6
RE: webmail client change pass
Update: new howto is in the wiki: http://www.isp-control.net/ispcp/wiki/howto_webmailpass

Ok, I did some digging in the infos about change_passwd in ispcp webmail.
There is an old thread with infos about how to do it with vhcs2 - but hey, vhcs2 is dead!

Ok. I'll write my notes down - it's not complete but will be...

Firs we need a mysql user which has access to the relevant tables/fields...
Code:
GRANT USAGE ON ispcp.*
TO 'ispcp-mail-user'@'localhost' IDENTIFIED BY '###greatpassword###'
WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0;

GRANT SELECT (`domain_id`, `domain_name`
) ON `ispcp`.`domain` TO 'ispcp-mail-user'@'localhost';

GRANT SELECT (`domain_id`, `alias_id`, `alias_name`
) ON `ispcp`.`domain_aliasses` TO 'ispcp-mail-user'@'localhost';

GRANT SELECT (`domain_id`, `subdomain_id`, `subdomain_name`
) ON `ispcp`.`subdomain` TO 'ispcp-mail-user'@'localhost';

GRANT SELECT ( `mail_acc`, `domain_id`, `sub_id`, `mail_type`, `status`, `mail_pass`),
UPDATE (`mail_pass` , `status`) ON `ispcp`.`mail_users` TO 'ispcp-mail-user'@'localhost';

Then we need to install the "change_sqlpass" plugin in webmail (squirrel). It needs the compatibility plugin but this seems already to be delivered with ispcp - change_sql_password on squirrelmail.org:
http://www.squirrelmail.org/plugin_view.php?id=25
Direct download: http://www.squirrelmail.org/plugin_downl...5&rev=1226
The plugin has to be stored in /var/www/ispcp/gui/tools/webmail/plugins/change_sqlpass - the last folder name is already in the tar file downloaded...
set the ownership and permissions to vu2000:vu2000 444 (files)

We have to activate the plugin
add this line to .../ispcp/gui/tools/webmail/config/config_local.php:
Code:
$plugins[26] = 'change_sqlpass';
(the index number should be higher than the ones from the already activated plugins...)

Then we need to adopt the config.php:
cp config.php.sample config.php

There are 3 variables to set...
Code:
$csp_dsn = 'mysql://ispcp-mail-user:###greatpassword###@localhost/ispcp';

$lookup_password_query = "SELECT count(DISTINCT t1.`mail_id`)
    FROM `mail_users` t1, `domain` t2, `domain_aliasses` t3, `subdomain` t4
    WHERE t1.`mail_acc` = '%2' AND t1.`mail_pass` = '%5' AND
     t2.`domain_id` = t1.`domain_id` AND t3.`domain_id` = t1.`domain_id` AND t4.`domain_id` = t1.`domain_id` AND
    (
     (t2.`domain_name` = '%3' AND  t1.`mail_type` = 'normal_mail') OR
     (t3.`alias_name` = '%3' AND t3.`alias_id` = t1.`sub_id` AND t1.`mail_type` = 'alias_mail') OR
     (CONCAT(t4.`subdomain_name`, '.', t2.`domain_name`) = '%3' AND t4.`subdomain_id` = t1.`sub_id` AND t2.`domain_id` = t1.`domain_id` AND t1.`mail_type` = 'subdom_mail')
    )";

$password_update_queries = array(
...not finished...
   );
well - there is the some complex sql code (since we don't have a filed with the complete mail address) - and the third one I don't have yet :-)
I first want to check if the WHEREs are all ok - before I change the passwords randomly :-)

So, maybe BeNe can open a wiki page for this... and maybe someone can have a look at this sql thing... (result of the lookup should be 1) :-)

Next step: last query and then a function call to "send_request()"...

/Joximu
(This post was last modified: 09-30-2007 09:03 AM by joximu.)
09-30-2007 07:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #7
RE: webmail client change pass
Of course --> http://www.isp-control.net/ispcp/wiki/howto_webmailpass

Thanks for this great work joximu!

Greez BeNe
09-30-2007 07:21 AM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #8
RE: webmail client change pass
Thanx BeNe, it's "in work"... :-)
09-30-2007 09:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #9
RE: webmail client change pass
Finished - it needed some changes in the plugin code from squirrel (we don't have a filed in the database with just the full mail address in it).
But now this works - request manager signal is also included...

Feedback is welcome - Joximu
09-30-2007 09:51 AM
Visit this user's website Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #10
RE: webmail client change pass
Perfect!
After dovecot now this nice feature.

I will test it today. Thanks joximu!

Greez BeNe
(This post was last modified: 09-30-2007 07:05 PM by BeNe.)
09-30-2007 06:48 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)