HOWTO: Use Horde + XAMPP with Hmailserver

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-01-15 22:18

This Tutorial is a walkthrough for installing Horde to work with Hmailserver and xampp. It assumes the following

1). You have a working hmailserver w/ preferably a default domain (named 'domain.com' in the writeup)
2). You have an admin user(s) (in the tutorial just one admin named admin) and normal users
3). You have an XAMPP installation (located at C:\xampp) with at least Apache, PHP, phpMyAdmin, and Mysql. You can have these things separately as well, though it would be harder to follow the tutorial.
4). You have set your MySQL password via the XAMPP security page to something other than the default (do this for security!)
5). You have a good text editor (like Notepad++)
6). An extractor (like 7-zip) for extracting Horde
7). Hmailserver and XAMPP are on the same computer (not necessary - just makes life easier)

On to the fun!

Download Horde Groupware Webmail (this tutorial uses version 1.2.1 - if you are using a different version, the lines might be lightly different, just search for the correct ones in this case) from the Horde Website and extract the folder from within the file (I use 7-zip for this). I would rename the folder since it will be the root of your installation. You can rename it whatever you'd like, but I will name it "horde".

Take the Horde folder and move it to C:\xampp\htdocs\ (webroot)

The horde webroot [Horde] is c:\xampp\htdocs\horde

We now will have 3 basic steps to go through to get Horde to work with hmailserver. We need to create the tables in the database for Horde, then edit a few php files to get Horde and hmailserver to talk, and lastly edit the php.ini file to allow for my memory and more modules.

Creating the Horde Database tables

Creating the database tables is relatively simple since Horde provides a PHP script. The script is located [horde]\scripts\setup.exe. Since XAMPP has php available, we will run the script in the command prompt using php. Open the command prompt and enter the following code

Code: Select all

C:\xampp\php\php.exe C:\xampp\htdocs\horde\scripts\setup.php
If you have done this correctly, you should get an output that asks you what the webroot is (the default is in brackets). Type

Code: Select all

/horde
Now you will get the following Menu

Code: Select all

Horde Groupware Webmail Edition Configuration Menu
<0> Exit
<1> Configure database settings
<2> Create database or tables
<3> Configure administrator settings
<4> Update from an older Horde Groupware Webmail Edition Version
We are going to need to do steps 1 and 2. Type 1 and push enter

Now we need to select the database type, type mysql and push enter
Request persistent Connection? Type 1
Username to connect to the database: type root
Password to connect with: Enter your mysql password that you setup through the XAMPP pages
How should we connect to the database?: type tcp
Database server/host: type localhost
Port the DB is running on, if non-standard: just push enter
Database name to use: type Horde
Internally Used charset: just push enter
Split reads to a different server: just push enter

Before we can go any further, we need to manually create the Horde database (dont close the command prompt). Occasionally Horde cannot create it (dunno why) so here's how you go about that. In your webbrowser (from the computer where xampp is located) type 'http://localhost/phpmyadmin'. This will login into the phpMyAdmin site and allow you to edit the MySql database. Login using root and whatever password you setup. At the front page after login, you'll see in the middle of the page a place that says "Create new database". In the field box below, type 'Horde', leave 'Collation' alone, and then click create. You should see the database then show up on the left hand side of the screen.

Now that is done. Now we need to create the tables within the database. Go back to the command prompt (hopefully you didn't close it)You should be back at the main menu now, so type 2 and push enter

You will be asked if you'd like Horde to create the database, which you don't since we already didn't that. Type 'n' and then push enter.
Database superuser for creating the database: root
Specify a password for the database user: Enter your mysql password that you setup through the XAMPP pages

You then you should get an output about Horde successfully creating a bunch of tables (for IMP, ingo, turba, kronolith, nag, and mnemo), as well as a 'Done creating Tables' dialog. Then you will be back at the menu. Type 0 to exit.

Editing the configuration files

We now need to edit three files to get Horde to properly work with hmailserver. The two files are
[Horde]/config/conf.php
[Horde]/config/registry.php
[Horde]/imp/config/servers.php

Note: for editing PHP files, I use notepad++. You can use whatever, but Notepad++ is nice.

In the conf.php file,

On line 32

Code: Select all

$conf['auth']['admins'] = array('Administrator');
Change Administrator to your admin user. Since the admin user in my example has the username "admin", i would replace that with admin. Since we have the default domain on (in hmailserver) we only need the username (the part before the @). If you have additional admin users, simply separate them by commas.

On line 73
Change

Code: Select all

$conf['mailer']['type'] = 'sendmail';
to

Code: Select all

$conf['mailer']['type'] = 'smtp';
This will make horde use SMTP (we will specify what SMTP server later). Lastly add the following line of code to the file (i do this just on line 74)

Code: Select all

$conf['mailer']['params']['auth'] = true;
This will make Horde authenticate with the SMTP server before sending mail

In the Registry.php file

We are going to name your webmail so that it doesn't say Horde everywhere. On line 50, there should be the following code

Code: Select all

'name' => ("Horde"),
Change Horde to whatever you want your webmail name to be. My code looks like

Code: Select all

'name' => ("Webmail"),
In the servers.php file

This is where we will add the IMAP/SMTP server for horde to use

Delete lines 223 on from servers.php and add the following lines there

Code: Select all

$servers['imap'] = array(
    'name' => 'Server Name',              <---------Name your webmail
    'server' => 'localhost',
    'hordeauth' => false,                  <-------- dont change this
    'protocol' => 'imap/notls',
    'port' => 143,
   'maildomain' => 'domain.com',           <---- add domain here
   'smtphost' => 'localhost',
   'smtpport' => 25,
    'quota' => array(
     'driver' => 'imap',
     
             
),

);
This specifies that the IMAP server is localhost (as is the SMTP server) and that we don't want to use Horde authentication (users are not in the horde database but elsewhere) . Also the quota portion pulls the quota you have set for each user, and displays it in their account and on their mail page.

Editing the PHP.ini file


We need to edit the php.ini file to allow Horde to have more memory and also to access additional PHP modules. To do this, open the php.ini file in a good text editor (Notepad++ for me) - php.ini is located at c:\xampp\apache\bin\php.ini or at c:\xampp\php\php.ini. You can use the xampp configurate pages (the phpinfo() ) area to find out which one it is

The first place to edit is line 246. We need to increase the amount of memory Horde can access. Allow Horde AT LEAST 128MB of memory (shown below)

Code: Select all

memory_limit = 128M ;
Next we need to allow additional php modules. These start at line 569. Uncomment (delete the ; ) in front of the follow modules
php_fileinfo.dll
php_ldap.dll
php_lzf.dll
php_mcrypt.dll
php_mhash.dll
php_memcache.dll
php_mime_magic.dll
php_openssl.dll
php_tidy.dll

To control the size of attachments allowed via Horde, you want to adjust line 514 (the code below is set for 16 MB upload)

Code: Select all

upload_max_filesize = 16M ;
Save your changes and you are now done editing.

Logging into Horde
If you already have the correct dns settings for your webserver, you can get to horde by going to http://domain.com/horde. If you do not, then you'll need to access Horde from the locahost by going to http://localhost/horde.

I would login with the admin user first. This way you can access the 'Administration' section of horde. If you have the default domain setup, simple type in the username of your admin user (in my case 'admin') and then the password. Horde should load up and you should be at the portal with the sidebar with the following options (Webmail, Mail, Organizing, Administration, Option, Logoff).

If you go into Administration, you can access the various options for each of the applications under the setup menu. This way you don't have to alter the code in the files. There are a ton of options in Horde to go through. A few suggestions for things I would change immediately.
1). Under IMP -> Compose, uncheck $conf[msg][prepend_header] and [append_trailer]. I think those are annoying. These options append and prepend text to each email. Turning them off is happy.
2). Get Aspell for windows (http://aspell.net/win32/) and enable it under IMP -> External Utilities and Menu -> Spell Checker.

Those are the big two for me, though there are many other I have changed as well.

It is also possible to add on the passwd app from the Horde site (so users can change their password via horde) and set it up to work it Hmailserver (not for version 5 unless you specify using version 4 password encryption), though it will require you to edit some of the PHP to get it to work correctly. In addition to the allowing users to change their password, I have also gotten the vacation app to correctly work with the hmailserver auto-reply, though this takes significantly more code editing than the passwd app.

The end

--------------------------------------------------------------------------------------------------------------------------

Vacation Module (version 3.0.1)

The Horde vacation module integrates with the hmailserver database fairly well. The only limitation of the module (that I have found) is the inability to set the auto-reply to expire automatically.

In order to get the vacation module to work with Hmailserver, there are two issues that we need to overcome.

1). If you use a default domain, you need to append "@domain.com" to the username. In order to set the auto-reply, the hmailserver database needs the full user name.

2). When Horde sets the auto-reply to on, it tries to write a 'Y' to the database, and when Horde turns it off, it writes an 'N'. Hmailserver, on the other hand, requires 1's and 0's for each.

To overcome these problems, we will have to edit the some of the PHP files. I'm sure there are many ways to achieve the editing, but I will provide the way that worked for me.

On to installing

First you need to download the vacation module. You can do this from the Horde site. After downloading it, extract the folder (using 7-zip or whatever). The version I will be using is 3.0.1. Once you have extracted the folder, you'll need to rename it from 'vacation-h3-3.0.1' to simply 'vacation'. Once you've done that, copy the entire folder to the root over your horde directory (if you are following the tutorial, that should be at C:\xampp\htdocs\horde\)

Now you'll need to login to Horde using your admin user. Open your web browser and point it to your horde installation, then login with your admin account. Go to the administration section on the left pane, and then go into setup. You should see "Vacation" as one of the available applications (if not then you've put the vacation folder in the wrong place). There are should some text that says there's a missing configuration file. Click the vacation that is linked.

Under the server configuration heading, we will put the appropriate items so that Horde can talk to the hmailserver database. You can edit other things if you'd like, but we need to change the server conf first. Here's what you should change:

$conf[server][driver] = SQL driver
$conf[server][params][default][driverconfig] = Custom Parameters
$conf[server][params][default][phptype] = MySQL
$conf[server][params][default][persistent] = checked
$conf[server][params][default][username] = the username to connect to the database (root if using XAMPP)
$conf[server][params][default][password] = your MySQL password
$conf[server][params][default][protocol] = TCP/IP
$conf[server][params][default][hostspec] = localhost
$conf[server][params][default][port] = 3306
$conf[server][params][default][database] = hmailserver
$conf[server][params][default][charset] = utf-8
$conf[server][params][default][splitread] = Disabled
$conf[server][params][default][table] = hm_accounts
$conf[server][params][default][user_col] = accountaddress
$conf[server][params][default][pass_col] = accountpassword
$conf[server][params][default][message] = accountvacationmessage
$conf[server][params][default][subject] = accountvacationsubject
$conf[server][params][default][vacation] = accountvacationmessageon
$conf[server][params][default][hordeauth] = Yes, with full username
$conf[server][params][default][encryption] = md5-hex
$conf[server][params][default][show_encryption] = unchecked

That's it for the configuration. Click the Generate Vacation Configuration button at the bottom of the screen.

Editting the PHP files

There's four files we are going to be interested in:

[horde]\conf\hooks.php
[horde]\vacation\main.php
[horde]\vacation\lib\Driver.php
[horde]\vacation\Driver\sql.php

The first thing we are going to do is fix the username problem (Note: you only need to do this if you have a default domain in hmailserver - if to login to horde you have to type user@domain.com in the username field, then you can skip the first part of the editing). We are going to do this by creating a hook. Open [horde]\conf\hooks.php. Anywhere after the first line add the following code (the entire file is commented by default)

Code: Select all

if (!function_exists('_vac_hook_username')) {
     function _vac_hook_username($user)
     {
         return $user . '@domain.com';
     }
}
Be sure to replace @domain.com with your domain. Now open the [horde]\vacation\main.php file. After this code (starting on line 26 for me)

Code: Select all

// Check if hordeauth is set to 'full'
$hordeauth = $driver->getParam('hordeauth', $realm);
if ($hordeauth === 'full') {
    $user = Auth::getAuth();
}
Add the following code:

Code: Select all

$user = Horde::callHook('_vac_hook_username',
                                          array($user));
That should append @domain.com to all the usernames so that the vacation module can interact with the hmailserver database.

Now to fixing the on and off issue. Open [horde]\vacation\lib\Driver.php. Changes lines 106 - 114 from

Code: Select all

        if ($current_details['vacation'] == 'y' ||
            $current_details['vacation'] == 'Y') {
            return 'Y';
        } elseif ($current_details['vacation'] == 'n' ||
                  $current_details['vacation'] == 'N') {
            return 'N';
        } else {
            return false;
        }
to

Code: Select all

        if ($current_details['vacation'] == '1' ||
            $current_details['vacation'] == '1') {
            return 'Y';
        } elseif ($current_details['vacation'] == '0' ||
                  $current_details['vacation'] == '0') {
            return 'N';
        } else {
            return false;
        }
That's it for that file. Now open [horde]\vacation\Driver\sql.php. Lines 96 - 110 will look like this:

Code: Select all

        $query = 'SELECT ' . $this->_params[$realm]['vacation'] . ' AS vacation' .
                 ' FROM ' . $this->_params[$realm]['table'] .
                 ' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?' .
                 ' AND ' . $this->_params[$realm]['pass_col'] . ' = ?';
        $values = array($myuser, $this->encryptPassword($password));
        $result = $this->_db->query($query, $values);
        if (!is_a($result, 'PEAR_Error')) {
            $query = 'INSERT INTO ' . $this->_params[$realm]['table'] .
                     ' (' . $this->_params[$realm]['vacation'] . ',' .
                     ' ' . $this->_params[$realm]['user_col'] . ',' .
                     ' ' . $this->_params[$realm]['pass_col'] . ')' .
                     ' VALUES ( ?, ?, ?)';
               $values = array('n', $user, $this->encryptPassword($password));
            $result = $this->_db->query($query, $values);
        }
change line 108 so that it looks like this

Code: Select all

        $query = 'SELECT ' . $this->_params[$realm]['vacation'] . ' AS vacation' .
                 ' FROM ' . $this->_params[$realm]['table'] .
                 ' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?' .
                 ' AND ' . $this->_params[$realm]['pass_col'] . ' = ?';
        $values = array($myuser, $this->encryptPassword($password));
        $result = $this->_db->query($query, $values);
        if (!is_a($result, 'PEAR_Error')) {
            $query = 'INSERT INTO ' . $this->_params[$realm]['table'] .
                     ' (' . $this->_params[$realm]['vacation'] . ',' .
                     ' ' . $this->_params[$realm]['user_col'] . ',' .
                     ' ' . $this->_params[$realm]['pass_col'] . ')' .
                     ' VALUES ( ?, ?, ?)';
            $values = array('0', $user, $this->encryptPassword($password));
            $result = $this->_db->query($query, $values);
        }
This is lines 113 - 119:

Code: Select all

        $query = 'UPDATE ' . $this->_params[$realm]['table'] .
                 ' SET ' . $this->_params[$realm]['vacation'] . ' = ?,' .
                 ' ' . $this->_params[$realm]['message'] . ' = ?,' .
                 ' ' . $this->_params[$realm]['subject'] . ' = ?' .
                 ' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?' .
                 ' AND ' . $this->_params[$realm]['pass_col'] . ' = ?';
        $values = array('y', $mymessage, $mysubject, $myuser, $this->encryptPassword($password));
Change line 119 so that it looks like this

Code: Select all

        $query = 'UPDATE ' . $this->_params[$realm]['table'] .
                 ' SET ' . $this->_params[$realm]['vacation'] . ' = ?,' .
                 ' ' . $this->_params[$realm]['message'] . ' = ?,' .
                 ' ' . $this->_params[$realm]['subject'] . ' = ?' .
                 ' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?' .
                 ' AND ' . $this->_params[$realm]['pass_col'] . ' = ?';
        $values = array('1', $mymessage, $mysubject, $myuser, $this->encryptPassword($password));
Lines 161 - 165 look like this:

Code: Select all

        $query = 'UPDATE ' . $this->_params[$realm]['table'] .
                 ' SET ' . $this->_params[$realm]['vacation'] . ' = ?' .
                 ' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?' .
                 ' AND ' . $this->_params[$realm]['pass_col'] . ' = ?';
        $values = array('n', $myuser, $this->encryptPassword($password));
Change line 165 so it looks like this

Code: Select all

        $query = 'UPDATE ' . $this->_params[$realm]['table'] .
                 ' SET ' . $this->_params[$realm]['vacation'] . ' = ?' .
                 ' WHERE ' . $this->_params[$realm]['user_col'] . ' = ?' .
                 ' AND ' . $this->_params[$realm]['pass_col'] . ' = ?';
        $values = array('0', $myuser, $this->encryptPassword($password));
And that's it. I worked through the vacation installation just as I did this tutorial and it worked great on a virtual machine. You can always check to see if it is working by looking directlyinto the database tables as you enable/disable the module (which is how I troubleshooted this from the beginning)

Enjoy!
Last edited by brucestr21 on 2009-07-01 23:17, edited 24 times in total.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by ^DooM^ » 2009-01-15 22:20

Awesome writeup! Nice work 8)
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

wanttoshop
New user
New user
Posts: 8
Joined: 2008-03-23 22:58

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by wanttoshop » 2009-01-17 20:54

After all but giving up on getting horde going you are a life saver.
Great tutorial
Thanks for getting me going.

davidtb
New user
New user
Posts: 10
Joined: 2009-02-10 18:09

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by davidtb » 2009-02-11 10:05

Can you explain the vacation(horde) configuration? Thanks! I've installed all modules ok, except the forwards and vacation modules... :oops:

Thanks!

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-02-11 18:10

davidtb wrote:Can you explain the vacation(horde) configuration? Thanks! I've installed all modules ok, except the forwards and vacation modules... :oops:

Thanks!
I have yet to figure out how to get the forwards module to work. I'll try to post up something about the vacation module sometime later this week when I have more time (it requires some editing of the php files to get it to work correctly with the hmailserver sql settings)
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-02-12 03:07

davidtb wrote:Can you explain the vacation(horde) configuration? Thanks! I've installed all modules ok, except the forwards and vacation modules... :oops:

Thanks!
Done - see the bottom of the tutorial
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

maheswaran
New user
New user
Posts: 6
Joined: 2009-03-06 16:37

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by maheswaran » 2009-03-06 16:42

Hi How to run
C:\xampp\php\php.exe C:\xampp\htdocs\horde\scripts\setup.php

in command line. I do not know how?. Can any one explain. Am using 1.5.4 Xampp version

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-03-06 17:38

maheswaran wrote:Hi How to run
C:\xampp\php\php.exe C:\xampp\htdocs\horde\scripts\setup.php

in command line. I do not know how?. Can any one explain. Am using 1.5.4 Xampp version
I dunno the folder structure of XAMPP 1.5.4 (i'm using 1.7.0), but if the folder structure is the same as the older ones, the you just need to go into the command prompt (start -> run -> type 'cmd' (without quotes) and press enter).
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

maheswaran
New user
New user
Posts: 6
Joined: 2009-03-06 16:37

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by maheswaran » 2009-03-07 08:08

hey i run in cmd line, but it does not do any thing.

My location is d:\program files\xampp

it gives "d:\program" is not a recognized external or internal command. How to run?
Attachments
err.png

maheswaran
New user
New user
Posts: 6
Joined: 2009-03-06 16:37

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by maheswaran » 2009-03-07 08:51

Thanks for this good hint, yes it did the magic and i completed all the settings, but i could not login with horde in admin end only i got

"Warning: bcompiler: Bad bytecode file format at 00000000 in Unknown on line 0" .

Could u tell me what is default user name and password for horde admin ...?

What is problem ?.

also is there possible to add test mail server to test with local. so am tested with this after that i do it live......

also

$servers['imap'] = array(
'name' => 'Server Name', <---------Name your webmail (What is differnt between this and add domain in below or other hand what is server name)
'server' => 'localhost',
'hordeauth' => false, <-------- dont change this
'protocol' => 'imap/notls',
'port' => 143,
'maildomain' => 'domain.com', <---- add domain here
'smtphost' => 'localhost',
'smtpport' => 25,
'quota' => array(
'driver' => 'imap',

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-03-07 18:29

maheswaran wrote:hey i run in cmd line, but it does not do any thing.

My location is d:\program files\xampp

it gives "d:\program" is not a recognized external or internal command. How to run?
In this case you'd have to put this in the command line (which I think you figured out)

"D:\program files\xampp\php\php.exe" "D:\program files\xampp\htdocs\horde\scripts\setup.php"
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-03-07 18:31

maheswaran wrote:Thanks for this good hint, yes it did the magic and i completed all the settings, but i could not login with horde in admin end only i got

"Warning: bcompiler: Bad bytecode file format at 00000000 in Unknown on line 0" .

Could u tell me what is default user name and password for horde admin ...?

What is problem ?.

also is there possible to add test mail server to test with local. so am tested with this after that i do it live......

also

$servers['imap'] = array(
'name' => 'Server Name', <---------Name your webmail (What is differnt between this and add domain in below or other hand what is server name)
'server' => 'localhost',
'hordeauth' => false, <-------- dont change this
'protocol' => 'imap/notls',
'port' => 143,
'maildomain' => 'domain.com', <---- add domain here
'smtphost' => 'localhost',
'smtpport' => 25,
'quota' => array(
'driver' => 'imap',

The default admin user depends on which user you specify as admin. From above:
In the conf.php file,

On line 32
Code:
$conf['auth']['admins'] = array('Administrator');

Change Administrator to your admin user. Since the admin user in my example has the username "admin", i would replace that with admin. Since we have the default domain on (in hmailserver) we only need the username (the part before the @). If you have additional admin users, simply separate them by commas.
The user that you specify as admin in Horde must exist in hmailserver as a user (otherwise Horde can't login). The password the the admin account will be whatever the admin users password is in hmailserver.

If you want to add a test mail user, you can do one of two things. You can simply edit the code you posted so that it will work for a local domain, or you can add an additional server in the servers.php file that reflects the settings of your local setup.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

maheswaran
New user
New user
Posts: 6
Joined: 2009-03-06 16:37

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by maheswaran » 2009-03-09 08:38

Hi,
ihave
"Warning: bcompiler: Bad bytecode file format at 00000000 in Unknown on line 0" .

Why this occur while trying to login in admin mode.....

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-03-10 03:24

I dunno what that error is. You'll have to search the internet or go to the Horde site for support
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

Agravan
New user
New user
Posts: 10
Joined: 2009-04-10 19:59

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by Agravan » 2009-04-14 23:36

I followed the above instructions, but I can't even get to a login prompt. It's stuck at "Waiting for http://....
Please help...

atwist
New user
New user
Posts: 2
Joined: 2009-05-06 16:13

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by atwist » 2009-05-06 16:15

Thanks for the great instructions. I am able to login with my "admin" users but they don't see an administration screen in horde. Does the Administration level in hmailServer need to be on something specific?

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-05-07 21:49

atwist wrote:Thanks for the great instructions. I am able to login with my "admin" users but they don't see an administration screen in horde. Does the Administration level in hmailServer need to be on something specific?
If you don't see the Administration Section in the left panel, then you didn't properly set your admin user in Horde. You'll need to go back to your conf.php file and be sure it is setup right. If you do not have a default domain setup in hmailserver, then you need to set your admin user as 'admin@domain.com' rather than just 'admin'.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

atwist
New user
New user
Posts: 2
Joined: 2009-05-06 16:13

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by atwist » 2009-05-14 20:17

Once I removed the extra Adminstrators from the conf.php file then things started working. So not sure why but that's what did it.

Bibhuti
New user
New user
Posts: 2
Joined: 2009-05-18 10:14

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by Bibhuti » 2009-05-19 18:41

Well, i have followed every instruction as said..
but this shows up when i try to log in visiting http://localhost/horde/


A fatal error has occurred

Session cookies will not work without a FQDN and with a non-empty cookie domain. Either use a fully qualified domain name like "http://www.example.com" instead of "http://example" only, or set the cookie domain in the Horde configuration to an empty value, or enable non-cookie (url-based) sessions in the Horde configuration.
Details have been logged for the administrator. :oops:

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-05-19 20:01

Bibhuti wrote:Well, i have followed every instruction as said..
but this shows up when i try to log in visiting http://localhost/horde/


A fatal error has occurred

Session cookies will not work without a FQDN and with a non-empty cookie domain. Either use a fully qualified domain name like "http://www.example.com" instead of "http://example" only, or set the cookie domain in the Horde configuration to an empty value, or enable non-cookie (url-based) sessions in the Horde configuration.
Details have been logged for the administrator. :oops:
Go to [Horde]/config/conf.php. Fine the line that reads:

Code: Select all

$conf['session']['use_only_cookies'] = true;
Change to:

Code: Select all

$conf['session']['use_only_cookies'] = false;
Then you should be golden. I tried to access my server from localhost and got the error when it was set to 'true'. I set it to 'false' and it worked great.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

gaganuiit
New user
New user
Posts: 28
Joined: 2009-06-20 12:34

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by gaganuiit » 2009-06-28 08:10

Well i have been successful following each and every instruction fo yours.
Now i want to learn two things.
1. How to use SSL?
2. How to install the addon Passwd to get the password changing working.
Yeah and please tell me how to set the version 4 password encryption as i am using hmailserver 5.1.2.
If u could provide me with full installation and configuration details of the passwd addon, i mean it will be great.

I am using Xampp for hosting, hMailServer 5.1.2 as admininistrator and Horde Groupware Webmail 1.2.3
:roll:

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-06-28 21:45

gaganuiit wrote:Well i have been successful following each and every instruction fo yours.
Now i want to learn two things.
1. How to use SSL?
2. How to install the addon Passwd to get the password changing working.
Yeah and please tell me how to set the version 4 password encryption as i am using hmailserver 5.1.2.
If u could provide me with full installation and configuration details of the passwd addon, i mean it will be great.

I am using Xampp for hosting, hMailServer 5.1.2 as admininistrator and Horde Groupware Webmail 1.2.3
:roll:
I assume you want to use https for ssl, rather than using SSL for IMAP. If you want to do this, you'll need to generate certificates for the apache server built into XAMPP. In the apache folder in your XAMPP root there is a makecert.bat file that can make certificates for you. Edit the .bat file for your personal needs. If you have trouble with this, there's another tutorial on the forums about how to generate certificates.

I'll see what I can do about the password addon
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

gaganuiit
New user
New user
Posts: 28
Joined: 2009-06-20 12:34

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by gaganuiit » 2009-06-28 21:51

Can you send me over the links to generating certificates please....
:arrow:

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-06-28 23:13

gaganuiit wrote:Can you send me over the links to generating certificates please....
:arrow:
Here's the link: http://www.hmailserver.com/forum/viewto ... 12&t=13953

Note that this for generating certificates for hmailserver. The certificates are the same type, but you'll have to move them into apache to get them to work for https. You'd be better off just running the makecert.bat file. XAMPP comes with openssl, so let XAMPP do the work for you :)
Last edited by brucestr21 on 2009-06-29 16:06, edited 1 time in total.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

gaganuiit
New user
New user
Posts: 28
Joined: 2009-06-20 12:34

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by gaganuiit » 2009-06-29 10:21

Thank you very much..
Now one thing that is left is the installation details of the addon passwd..
See ya..(soon :mrgreen: )

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-06-30 02:31

Alrighty, for the password addon, you'll need to change a few things. First, go to your hmailserver installation directory and go into the bin directory. Open the hmailserver.bin file. Add to or change the file with the following code (I just appended it to the bottom)

Code: Select all

[Settings]
PreferredHashAlgorithm=2
Now you'll need to go into the Horde directory.

====================================
NOTE: Only perform the next step if you DO have a default domain. This part will append the domain name to the username so the Horde username can be translated for the hmailserver database.
Go to [Horde]\passwd\config\conf.php . Add or change these two lines:

Code: Select all

$conf['hooks']['full_name'] = true;
$conf['hooks']['default_username'] = false;
$conf['hooks']['username'] = true;
$conf['hooks']['userdn'] = false;
or you can use your administrator account and setup the password addon online to look like this:
passwd.JPG

Now go to [Horde]\config\hooks.php. This entire file is commented, so just go to the end of the file and add these lines. This is the line that will append the domain name to the username.

Code: Select all

if (!function_exists('_passwd_hook_username')) {
     function _passwd_hook_username($userid)
     {
         return $userid . '@domain.com';
     }
}
Change domain.com to your domain name.
==================================





==================================
Added Part
==================================

Now you'll need to get the password plugin interfacing with the hmailsever database. The tutorial below assumes you are using the XAMPP MySQL database with the database name 'hmailserver' for your hmailserver database. If you are using the internal MSSQL database, then you'll need to make the appropriate changes to the sql backend to get it to work - i dunno what those are since I use MySqL. If your users are authenicated through AD, I'm not sure how to integrate that either.

Go to [horde]\passwd\config\backends.php.dist. First rename the file to backends.php

Now you'll need to comment out the entire file with the exception of the first line. There are too many backends enabled by default. Once you've commented everything out, go to the section that reads (line 275 for me)

Code: Select all

$$backends['sql'] = array (
Uncomment the entire sql array. Here's what you should make yours look like:

Code: Select all

$backends['sql'] = array (
    'name' => 'Default Mail Server',                <--------------------Give it a name
    'preferred' => '',
    'password policy' => array(                     <------- Create a password policy
        'minLength' => 3,
        'maxLength' => 15,
        'maxSpace' => 0,
        'minUpper' => 0,
        'minLower' => 1,
        'minNumeric' => 0,
        'minSymbols' => 0
    ),
    'driver' => 'sql',
    'params' => array(
        'phptype'    => 'mysql',   <----- mysql if using XAMPP
        'hostspec'   => 'localhost',
        'username'   => 'root',                <----username = root if using XAMPP
        'password'   => 'password',       <---- change this to MySQL password
        'encryption' => 'md5-hex',
        'database'   => 'hmailserver',
        'table'      => 'hm_accounts',
        'user_col'   => 'accountaddress',
        'pass_col'   => 'accountpassword',
        'show_encryption' => false
        // The following two settings allow you to specify custom queries for
        // lookup and modify functions if special functions need to be
        // performed.  In places where a username or a password needs to be
        // used, refer to this placeholder reference:
        //    %d -> gets substituted with the domain
        //    %u -> gets substituted with the user
        //    %U -> gets substituted with the user without a domain part
        //    %p -> gets substituted with the plaintext password
        //    %e -> gets substituted with the encrypted password
        //
        // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE user_uid = %u',
        // 'query_modify' => 'UPDATE horde_users SET user_pass = %e WHERE user_uid = %u',
    )
);

Hopefully that gets you working. If not I'll upload my backends.php for you to use, of course with my information removed.
Last edited by brucestr21 on 2009-07-01 03:20, edited 8 times in total.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

gaganuiit
New user
New user
Posts: 28
Joined: 2009-06-20 12:34

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by gaganuiit » 2009-06-30 19:03

I would like to know which version of passwd addon you used for this particular installation.
Coz i am using passwd-h3-3.1.tar.gz and i dont find any conf.php in its config directory all i see with a conf named file is conf.xml and there is no such code in it as given by you.
Any suggestions regarding this :?:

gaganuiit
New user
New user
Posts: 28
Joined: 2009-06-20 12:34

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by gaganuiit » 2009-06-30 19:30

Well i found that the way to create the conf.php was through the administrative setup.
Now i followed your instructions..
But this error cropped up saying:Failure in changing password for example.com: The system cannot find the path specified. (Exit Status: 1)
I think there is something wrong with my horde\config\conf.php settings or somewhere where it should be mydomain.com instead of example.com as this error reveals, but where specifically?
Suggest :?:
Attachments
error.JPG

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-06-30 22:58

gaganuiit wrote:Well i found that the way to create the conf.php was through the administrative setup.
Now i followed your instructions..
But this error cropped up saying:Failure in changing password for example.com: The system cannot find the path specified. (Exit Status: 1)
I think there is something wrong with my horde\config\conf.php settings or somewhere where it should be mydomain.com instead of example.com as this error reveals, but where specifically?
Suggest :?:
I forgot a part of the installation. My fault. See post above
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

gaganuiit
New user
New user
Posts: 28
Joined: 2009-06-20 12:34

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by gaganuiit » 2009-07-01 06:48

I have made the changes to the backends.php file as were provided by you but i am still getting the same error...
Failure in changing password for example.com: The system cannot find the path specified. (Exit Status: 1)
I think somewhere there is this example.com where it should be hpu.com as i have domain name as hpu.com

Suggestions please..

Agravan
New user
New user
Posts: 10
Joined: 2009-04-10 19:59

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by Agravan » 2009-08-15 16:33

I'm running Hmailserver 5.5.5-b341 with Horde Webmail edition
I have followed your instruction to the letter but cannot seem to get my vacation module to work. It does look like it's working, but does not actually change the vacation status in Hmailserver database.
My Hmailserver/Horde configuration is set to authenticate with LDAP.
Would that make a difference? I need help gettin
g this set up for my users or I will have to go in everytime someone needs to be off and manually add the autoreply.

Also, did you ever get the forwards working?
Thanks

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by ^DooM^ » 2009-08-15 17:20

Agravan wrote:I'm running Hmailserver 5.5.5-b341 with Horde Webmail edition
Thats a neat trick considering we are only upto V5.2 :D
My Hmailserver/Horde configuration is set to authenticate with LDAP.
hMail doesn't auth with LDAP only AD and it's own..

I suggest you recheck you have added admin passwords to vacation plugin and made sure it has correct permissions to run.
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Agravan
New user
New user
Posts: 10
Joined: 2009-04-10 19:59

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by Agravan » 2009-08-15 17:28

ok, I meant 5.1.1

Agravan
New user
New user
Posts: 10
Joined: 2009-04-10 19:59

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by Agravan » 2009-08-15 17:30

^DooM^ wrote:
Agravan wrote:I'm running Hmailserver 5.5.5-b341 with Horde Webmail edition
Thats a neat trick considering we are only upto V5.2 :D
My Hmailserver/Horde configuration is set to authenticate with LDAP.
hMail doesn't auth with LDAP only AD and it's own..

I suggest you recheck you have added admin passwords to vacation plugin and made sure it has correct permissions to run.
OK, so where would I look for this info?

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by ^DooM^ » 2009-08-15 18:19

huh? you said you followed the steps.

$conf[server][params][default][password] = your MySQL password

They are admin passwords well MySQL password (same thing in my book only admin has access to em)

If it hasn't updated the database there is something wrong with the plugin. If you are sure the passwords and users are correct then the script is wrong.

Suggest you start debugging :)
If at first you don't succeed, bomb disposal probably isn't for you! ヅ

Agravan
New user
New user
Posts: 10
Joined: 2009-04-10 19:59

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by Agravan » 2009-08-15 18:31

^DooM^ wrote:huh? you said you followed the steps.

$conf[server][params][default][password] = your MySQL password

They are admin passwords well MySQL password (same thing in my book only admin has access to em)

If it hasn't updated the database there is something wrong with the plugin. If you are sure the passwords and users are correct then the script is wrong.

Suggest you start debugging :)
OK I had that. I thought you meant another password somewhere.
I'll debug it today
thanks

brucestr21
Normal user
Normal user
Posts: 96
Joined: 2008-06-23 18:47

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by brucestr21 » 2009-08-17 01:20

Agravan wrote:I'm running Hmailserver 5.5.5-b341 with Horde Webmail edition
I have followed your instruction to the letter but cannot seem to get my vacation module to work. It does look like it's working, but does not actually change the vacation status in Hmailserver database.
My Hmailserver/Horde configuration is set to authenticate with LDAP.
Would that make a difference? I need help gettin
g this set up for my users or I will have to go in everytime someone needs to be off and manually add the autoreply.

Also, did you ever get the forwards working?
Thanks
Make sure you are using the version of Vacation I used in the tutorial. Newer versions of the vacation plugin work differently with the database and my tutorial won't work with those versions.
hMailServer v5.2.1 Build 360
XAMPP 1.70
Horde Groupware Webmail 1.2.3
Windows Server 2003 SBS

JessG
New user
New user
Posts: 1
Joined: 2009-09-07 02:11

Re: HOWTO: Use Horde + XAMPP with Hmailserver

Post by JessG » 2009-09-07 02:16

Ok... I've been a little creative and used my MailEnable setup instead.

All I did was change IMAP settings to POP3 settings.
This has resulted in the following message after I login to the webmail service:

Warning: require_once(C:\Program Files\xampplite\htdocs\horde\imp\lib/Quota/POP3.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\xampplite\htdocs\horde\imp\lib\Quota.php on line 89

Fatal error: require_once() [function.require]: Failed opening required 'C:\Program Files\xampplite\htdocs\horde\imp\lib/Quota/POP3.php' (include_path='C:\Program Files\xampplite\htdocs\horde\lib;C:\Program Files\xampplite\htdocs\horde\lib/../pear') in C:\Program Files\xampplite\htdocs\horde\imp\lib\Quota.php on line 89


When I go to line 89 in the quota file I find the following line:

require_once dirname(__FILE__) . '/Quota/' . $driver . '.php';

I take it that the $driver statement is not in order... do you have a solution to that issue?

Post Reply