Author Topic: DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist  (Read 12004 times)

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
Please forgive my stupidity as I am new at this and I probably have a setting wrong, but I am getting the following error:

[03-Jul-2015 02:42:33 +0000]: <itihmh3b> DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist (SQL Query: SELECT update_passwd('$1$UlnuLyzr$HU9CGLTLgjY28VfV8ypbb/', 'mail@149ersfan.com')) in C:\Inetpub\vhosts\s18384471.onlinehome-server.com\1sportsfanmail.com\Roundcube\program\lib\Roundcube\rcube_db.php on line 543 (POST ?_task=&_action=)


OS: Microsoft Windows Server 2008 R2 Service Pack 1
Plesk version: 12.0.18 Update #52 , last updated at June 25, 2015 08:04 PM
Hmail 5.6.3-B2249
Server: 127.0.0.1 via TCP/IP
Server type: MySQL
Server version: 5.1.73-community - MySQL Community Server (GPL)
Protocol version: 10

I suspect one of these is wrong?
$config['password_db_dsn'] = 'mysql://DBusername:DBpassword@localhost/hmailserver1';
$config['password_query'] = 'SELECT update_passwd(%c, %u)';
$config['password_crypt_hash'] = 'md5';
$config['password_directadmin_host'] = 'tcp://localhost';

// TCP port used for DirectAdmin connections
$config['password_directadmin_port'] = 2222;

// hMail Driver options
// -----------------------
// Remote hMailServer configuration
// true:  HMailserver is on a remote box (php.ini: com.allow_dcom = true)
// false: Hmailserver is on same box as PHP
$config['hmailserver_remote_dcom'] = false;
// Windows credentials
$config['hmailserver_server'] = array(
    'Server' => 'localhost', // hostname or ip address
    'Username' => 'myhmailserverusername', // windows username
    'Password' => 'myhmailserverpassword' // windows user password
);


Thanks in advance for any help that is rendered

Online SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
You need to change the password_query to a sql query that will change the password.

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
Thanks

I will try to figure it out as I am not well versed in this.

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
I played around and got it to change the password in the database, but I used plain text option.  It looks like the encrypted option is MD5 but I installed Hmail 5 so it says they use SHA 256 but in the php file I do not see that as an option?

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
I think I'm getting closer but when I change password I see the field change in the database but get invalid user name/password when I try to login with the new password.  So I'm guessing the encryption setting I have are off.

Here is what I have, again any help is greatly appreciated

// The SQL query used to change the password.
// The query can contain the following macros that will be expanded as follows:
//      %p is replaced with the plaintext new password
//      %c is replaced with the crypt version of the new password, MD5 if available
//         otherwise DES. More hash function can be enabled using the password_crypt_hash
//         configuration parameter.
//      %D is replaced with the dovecotpw-crypted version of the new password
//      %o is replaced with the password before the change
//      %n is replaced with the hashed version of the new password
//      %q is replaced with the hashed password before the change
//      %h is replaced with the imap host (from the session info)
//      %u is replaced with the username (from the session info)
//      %l is replaced with the local part of the username
//         (in case the username is an email address)
//      %d is replaced with the domain part of the username
//         (in case the username is an email address)
// Escaping of macros is handled by this module.
// Default: "SELECT update_passwd(%c, %u)"
$config['password_query'] ='UPDATE hm_accounts SET accountpassword=%c WHERE accountaddress=%u LIMIT 1';

// By default the crypt() function which is used to create the '%c'
// parameter uses the md5 algorithm. To use different algorithms
// you can choose between: des, md5, blowfish, sha256, sha512.
// Before using other hash functions than des or md5 please make sure
// your operating system supports the other hash functions.
$config['password_crypt_hash'] = 'sha256';

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
I looked in Hmail ini file and PasswordEncryption =1 which is blowfish  I changed the config files and hmail is still returning invalid username/password after I change the password in Roundcube.

what am I missing?

$config['password_query'] ='UPDATE hm_accounts SET accountpassword=%c WHERE accountaddress=%u LIMIT 1';
$config['password_crypt_hash'] = 'blowfish';


[Database]
Type=MYSQL
Username=xxxxxxx
Password=xxxxxxxxxxxxxxx
PasswordEncryption=1
Port=3306
Server=localhost
Database=hmailserver1
Internal=0

Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
I have only one word for you SteveG... DCOM

Forget messing with SQL... Whip up the hMailServer manual and start reading.

Check out the "hmail" driver for the Roundcube Password plugin.

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
Soren

I can see the password change in the SQL database, but apparently its the wrong encryption. I just need to figure out the right commands in the Roundcube config.  I have spent days trying to learn this and being so close, I really don't have the time to learn something new.




Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
Soren

I can see the password change in the SQL database, but apparently its the wrong encryption. I just need to figure out the right commands in the Roundcube config.  I have spent days trying to learn this and being so close, I really don't have the time to learn something new.
Well, you don't have a choice unless you want to restart hMailServer every time you change a password  ::)

- or - change the "Performance settings in hMailServer to eliminate caching.

Using DCOM the changes are instant (and cached) and it's really a 5 minute job.

If you are using Linux (like me)... Well... Things suddenly become a lot more complicated  ;)
Fortunately Apache Reverse Proxy works pretty well with IIS and hMailServer  :P

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
i have unchecked caching and restarted hmail server and I am on a windows server.
Easy for you to say as you know this stuff, but I know squat LOL

Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
Re: DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist
« Reply #10 on: July 03, 2015, 07:02:15 PM »
i have unchecked caching and restarted hmail server and I am on a windows server.
Easy for you to say as you know this stuff, but I know squat LOL
We have all been where you are now  8)

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
Re: DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist
« Reply #11 on: July 04, 2015, 01:51:17 PM »
OK I decided to give it a go.
Changed the hmail php from SQL

[04-Jul-2015 17:44:58 +0000]: <rcgtnalf> Plugin password (hmail driver): Failed to create COM object `hMailServer.Application': Access is denied.
[04-Jul-2015 17:44:58 +0000]: <rcgtnalf> Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.

I am stuck at DCOM permissions all 3 have allow, do I have to add one?


Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
Re: DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist
« Reply #12 on: July 04, 2015, 06:32:42 PM »
I am stuck at DCOM permissions all 3 have allow, do I have to add one?
https://www.hmailserver.com/documentation/latest/?page=howto_dcom_permissions

I connect to my server in all sorts of ways so I've added "Everyone" for Local Launch & Local Activation and "Everyone" for Local Access. On my server "Everyone" and "Internet Guest Account" have the same settings in the hMailServer DCOM properties.

"Everyone" as I connect from different computers with different credentials across my LAN ;-)

You need to verify the user used by your IIS (or Apache) as this is the user that will need permission.
« Last Edit: July 04, 2015, 06:36:35 PM by SorenR »

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
Re: DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist
« Reply #13 on: July 04, 2015, 08:23:00 PM »
I think I found it but now I get this

[04-Jul-2015 23:49:14 +0000]: <2sqsn731> IMAP Error: Login failed for test@1sportsfanmail.com.com from xx.xxx.xxx.xx. LOGIN: Invalid user name or password. in C:\Inetpub\vhosts\s18384471.onlinehome-server.com\1sportsfanmail.com\Roundcube\program\lib\Roundcube\rcube_imap.php on line 198 (POST ?_task=login&_action=login)
« Last Edit: July 04, 2015, 08:28:38 PM by wallst001 »

Offline wallst001

  • Jr. Member
  • **
  • Posts: 12
Re: DB Error: [1305] FUNCTION hmailserver1.update_passwd does not exist
« Reply #14 on: July 04, 2015, 10:51:03 PM »
And right back to this.
This seems like it should not be that hard

[05-Jul-2015 02:48:16 +0000]: <0tg734bd> Plugin password (hmail driver): Failed to create COM object `hMailServer.Application': Access is denied.
[05-Jul-2015 02:48:16 +0000]: <0tg734bd> Plugin password (hmail driver): This problem is often caused by DCOM permissions not being set.