• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

[HOW-TO] How to Fix Changing Passwords in Horde/IMP Webmail

S

stupidnic

Guest
Recently a customer contacted me about the "Change your password" option in Horde/IMP coming back and saying "Failure in changing password on this server: Incorrect Password" even though he was entering the correct information.

First of all, verify that poppassd is running on your server (port 106) and is accessable (not blocked by a firewall). You can even test poppassd by running the following:

telnet localhost 106

You should see the following:

Connected to localhost.localdomain.
Escape character is '^]'.
200 poppassd hello, who are you?


Now type:

user [email protected]

where [email protected] is a valid mailbox/domain combination for the server you are on.

Then type:

pass oldpassword

where oldpassword is the current password for the user you entered.

Finally type:

newpass newpassword

where newpassword is the password you want to change to.

You should see:

200 Password changed, thank-you.

Type quit to close the session.

If all of that works, your poppassd is working correctly, so you have the problem I had.

There is apparently a bug (more specifically, code is commented out that shouldn't be commented out) in Horde/IMP webmail.

The file you need to edit is:

<path-to-horde-dir>/config/hooks.php

Where <path-to-horde-dir> is the directory where your horde installation is. In my case (Plesk 8.0.1 on Debian 3.1) it is /usr/share/psa-horde.

Open the hooks.php file and change the following code block from:

PHP:
// if (!function_exists('_passwd_hook_default_username')) {
//     function _passwd_hook_default_username($userid)
//     {
//         return $userid;
//     }
// }

To:

PHP:
if (!function_exists('_passwd_hook_default_username')) {
     function _passwd_hook_default_username($userid)
     {
         return $userid;
     }
}

Basically you are removing the comment indicator (//) from the begining of each line.

With these lines commented out there is a missing function that horde is unable to call that is supposed to return the username for the current session. On failure it returns a PHP object that gets passed to the poppassd daemon as the username (Object), which will fail.

Disclaimer:
Am I 100% this is the correct fix for this particular issue? No.

Does it work for me? Yes.

Will it work for you? Not sure. you need to test it.
 
You are my hero

Thanks so much for your detailed analysis of the problem. Your fix worked for my Plesk 8.1 server like a charm. :)
 
Back
Top