How to link hmail with horde?

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
The Voice Of Wolves
New user
New user
Posts: 2
Joined: 2007-03-15 17:43

How to link hmail with horde?

Post by The Voice Of Wolves » 2007-03-15 17:58

This is my first topic at this forum and I can say that hmail is very intersting software. My problem is very simple as an idea. Perhaps a little difficult to do it. I have installed horde in a simple test pc with windows XP. I have setup everything (almost everything - some points are problems of horde yet) but i have some problems with the linking hmail and horde in authentication. I can't create new accounts, modify them or delete them (perhaps there are many problems for this section that i haven't see them yet).

My question is simple. How to make horde create email accounts in hmail database?

I think the field that I need for this are:

Authenticate the user
Add user
Update user
Remove user
List users

I need the sql commands for those options :/

I have made some sql for authenticate the user and list users

Authenticate the user -> SELECT * FROM hm_accounts WHERE accountaddress = \L AND accountpassword = \P AND accountactive = '1'

List users -> SELECT accountaddress FROM hm_accounts

But i am still in the search. I am wondering if someone has the solution (I don't want to spend days searching for the correct sql command :/)

The Database is MS SQL SERVER 2005.

Thanks for your time.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2007-03-15 18:30

Never heard of anyone here in the forum doing this so I don't think anyone here knows the answer.

The Voice Of Wolves
New user
New user
Posts: 2
Joined: 2007-03-15 17:43

Post by The Voice Of Wolves » 2007-03-16 16:11

How to link horde with hmail.
(with win XP and Ms SQL Server 2005 - Perhaps it works with other dbs or installations)

1) Loggin as Administrator in Horde
2) Then go Administration->Config->Horde->Authentication
3) On: What backend should we use for authenticating users to Horde? select: SQL Authentication w/custom made queries

Then set the values:

The name of the database: Microsoft SQL Server

What protocol will we use to connect to the database? TCP/IP

Port the DB is running on, if non-standard: Empty (if there is a port here like 5432, clear it. Be careful. Horde autoinserts this value any time you setup this page. Insert a port if is needed only)

What hostname is the database server running on, or what is the name of the system DSN to use? 192.168.0.113 (Here insert dns or ip of your database server. I suggest ip, for more stable and quickly performance)

What username do we authenticate to the database server as? sa (your database username)

What password do we authenticate to the database server with? mydbpsswrd (here set your database password for the previous username. You must have one, for security reasons)

What database name/tablespace are we using? hmail (the name of hmailserver database)

The needed queries:

Authenticate the user

SELECT * FROM hm_accounts WHERE accountaddress = \L AND accountpassword = \P AND accountactive = '1'

Add user

INSERT INTO hmail.dbo.hm_accounts (accountdomainid, accountadminlevel, accountaddress, accountpassword, accountactive, accountisad, accountaddomain, accountadusername, accountmaxsize, accountvacationmessageon, accountvacationmessage, accountvacationsubject, accountpwencryption, accountforwardenabled, accountforwardaddress, accountforwardkeeporiginal, accountenablesignature, accountsignatureplaintext, accountsignaturehtml) VALUES(2, 0, \L, \P, 1, 0, '', '', 0, 0, '', '', 2, 0, '', 0, 0, '', '')

Update user

UPDATE hmail.dbo.hm_accounts SET accountaddress = \L, accountpassword = \P WHERE accountaddress = \O

Remove user

DELETE FROM hmail.dbo.hm_accounts WHERE accountaddress = \L

List users

SELECT accountaddress FROM hm_accounts


Save this and try it.

I hope it will help you, if you needed that.

Dear martin, i hope this one guide in under forums rules. Thanks your post anyway. I found it myself with a little help from some partners and google. :)

plobby
Normal user
Normal user
Posts: 115
Joined: 2008-01-29 07:04

Post by plobby » 2008-02-27 06:20

Does anyone have this for a mysql install?

Post Reply