Author Topic: Problem with password pluging with remote hmailserver  (Read 13916 times)

Offline marcovnet

  • Newbie
  • *
  • Posts: 2
Problem with password pluging with remote hmailserver
« on: March 15, 2016, 06:55:39 PM »
Hi, sorry for my english!

I have a problem with change password plugin

I have:
- hmailserver on Windows Server 2008 with integrate db
- Roundcube on linux pc with centos 6.7 (ver. 1.1.4)
- php 5.6.19 on linux

In my config.inc.php on password plug in

$config['password_driver'] = 'hmail';
[......]
// 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'] = true;
// Windows credentials
$config['hmailserver_server'] = array(
    'Server' => '192.9.51.200', // hostname or ip address <- Windows Server
    'Username' => 'administrator', // windows username
    'Password' => 'xxxxxxxxxxx' // windows user password
);

PHP.ini on linux machine

[COM]
com.allow_dcom = true


When i try to change the password the error is :
[15-Mar-2016 23:40:06 Europe/Rome] PHP Fatal error:  Class 'COM' not found in /var/www/html/roundcubemail/plugins/password/drivers/hmail.php on line 38

In windows machine then firewall is turn off and i don't have error of DCOM in the registry.

Can you help me?

Thanks



Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,879
    • SKaero - Custom Roundcube development
Re: Problem with password pluging with remote hmailserver
« Reply #1 on: March 15, 2016, 07:10:44 PM »

Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
Re: Problem with password pluging with remote hmailserver
« Reply #2 on: March 16, 2016, 10:23:26 AM »
Maybe this thread will help: http://www.roundcubeforum.net/index.php?topic=15735.0
You link to a thread where You claim not to be a Windows expert... Well, You can't be much of a Linux expert either when OP state he got problems with DCOM on a Linux OS... Since when do Linux have support for DCOM ??

Quote
I have:
- hmailserver on Windows Server 2008 with integrate db
- Roundcube on linux pc with centos 6.7 (ver. 1.1.4)
- php 5.6.19 on linux

Quote
PHP.ini on linux machine

[COM]
com.allow_dcom = true

Quote
[15-Mar-2016 23:40:06 Europe/Rome] PHP Fatal error:  Class 'COM' not found in /var/www/html/roundcubemail/plugins/password/drivers/hmail.php on line 38

Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
Re: Problem with password pluging with remote hmailserver
« Reply #3 on: March 16, 2016, 10:24:48 AM »
Hi, sorry for my english!

I have a problem with change password plugin

I have:
- hmailserver on Windows Server 2008 with integrate db
- Roundcube on linux pc with centos 6.7 (ver. 1.1.4)
- php 5.6.19 on linux
Sorry, you need to run RoundCube on a Windows OS for the HMS plugin to work. COM/DCOM is NOT supported on Linux.

Offline marcovnet

  • Newbie
  • *
  • Posts: 2
Re: Problem with password pluging with remote hmailserver
« Reply #4 on: March 18, 2016, 05:07:41 AM »
Thanks for the reply.
There is another plug-in provided?

Thanks

Offline SorenR

  • Jr. Member
  • **
  • Posts: 13
Re: Problem with password pluging with remote hmailserver
« Reply #5 on: March 18, 2016, 07:56:45 AM »
Thanks for the reply.
There is another plug-in provided?

Thanks
Not really... You CAN use the normal password plugin with some adaptation IF you change the encryption method used in hMailServer... NOT a job for the beginner - if you have more than 2 accounts on the server  ;)

hMailServer uses SHA256 as default but these options are available:

Code: [Select]
PreferredHashAlgorithm  - This setting allows you to specify which hashing algorithm hMailServer should use for passwords in the hMailServer database. In old versions of hMailServer, passwords were stored in plain text. In hMailServer 4, passwords were stored in MD5. In hMailServer 5, the default preferred hash is now salted SHA256. The following values are valid for this setting:
0 - None. Store passwords in clear text. This is not recommended.
1 - Blowfish. Store passwords encrypted using Blowfish. This is not recommended, since the password used for encryption is known. Hence, this is no more safe than option 0.
2 - MD5. Store passwords in MD5 hash. This is only recommended to preserve backwards compatibility if you have application which integrates with the hMailServer database.
3 - SHA256 - Store passwords in SHA256 hashes. This is currently the recommended option which gives the highest level of security.

If you are using SHA256, this is the way to store new passwords. NOTE; YOU CANNOT REVERSE IT TO SEE PASSWORD!

1. Generate 6 character random string containing characters 0-9, A-F (hex string). This is SALT.
2. Create a new string, TEMP containing SALT + users password.
3. Generate SHA256 hash for TEMP. This is the HASH.
4. In the database, store the string SALT + HASH in the password column.