So I managed to introduce Horde Services for 13,000 user accounts, do the complete LDAP backend connection and using Cyrus IMAP as mail server. The system runs on 4 nodes (2 active and 2 standby), serving approx 600-800 users concurrently (for Horde Web/IMP) and 2000 users concurrently (for IMAP4 mail).
But then there was the question for SyncML and synchronization of the turba addressbooks and the kronolith calendar dates to a mobile device... And yes, it had to work on Windows Mobile...
Solution is - of course - Funambol. They offer nice community edition clients free to use implementing SyncML on many platforms, Windows Mobile is one of them. But it is not so "standard compatible" - it was impossible to sync... Until I discovered the reason: The "configuration" tree which does not exist in Horde!
Short: To make Funambol Client for Windows Mobile work with the Horde framework, you have to do four things:
In my case I have three new directories:
.....horde/syncconf/
.....horde/syncconf/config
.....horde/syncconf/lib
I began with the API. This is the easy part, it looks like this:
As you see, we don't return anything useful. These functions always return an empty result - an empty string or an empty array. But that will do the trick!
Save that file as "....horde/syncconf/lib/api.php" and you have your superb new API! (returning nothing, wha whaaaaa).
Now make a fake configuration (Horde DOES WANT a configuration! No chance if you don't have one). Create file conf.php as ....horde/syncconf/config/conf.php:
put in whatever you want.
You may omit the last "?>" as all included Horde files do. I am just accomodating to their style.
Now it is time to register this "application" - hey we don't even have a user interface - all we have is a dumb api and a nonsense config. So we have to insert this in ....horde/config/registry.php (the Horde application registry):
Please make sure that the status is 'hidden' otherwise Horde will have some big problem...
Last, define "configuration" as valid SyncML database name. Unfortunately, there is not a small configuration file to achieve this, no, you have to patch Backend.php and Backend/Sql.php (real paths described above).
In ....horde/lib/SyncML/Backend.php you'll find these lines:
Note I just added "case 'configuration';" to the switch statement.
The same applies to ....horde/lib/SyncML/Backend/Sql.php:
Same trick as above: I just inserted "case 'configuration';".
Now you're ready to run.
The SyncML server URL is just
https://your_horde_server/horde/rpc.php
I used an Apache Alias statement to change this to
https://our_horde_site/sync
And it works.
The first run (after entering server url, username and password) will fail though, the Funambol client just does not like to have zero data (as our api does not return anything). But after acknowledging this "error" with ok, it will work and synchronizes Contacts, Tasks, Calendar items and Notes!
Please make sure that neither "E-Mail" nor "Briefcase" are selecedt in the PIM settings of the Funambol Client. These won't work.
Just use normal IMAP4 account data for Windows Mobile Messaging to get your email on your phone/mobile device.
Mission accomplished.
Yes, I hate PHP.
But Horde is quite cool.
- Define an extra application api in your Horde tree (I named it "syncconf").
- Register it saying it provides "configuration/list", "configuration/listBy" and "configuration/import"
- Patch horde/lib/SyncML/Backend.php to accept "configuration" as database
- Patch horde/lib/SyncML/Backend/Sql.php to accept "configuration" as database
In my case I have three new directories:
.....horde/syncconf/
.....horde/syncconf/config
.....horde/syncconf/lib
I began with the API. This is the easy part, it looks like this:
<?php
$_services['import'] = array(
'args' => array('content' => 'string', 'contentType' => 'string', 'source' => 'string'),
'type' => 'string',
);
$_services['listBy'] = array(
'type' => '{urn:horde}stringArray'
);
$_services['list'] = array(
'type' => '{urn:horde}stringArray'
);
function _syncconf_import($content, $contentType = 'array', $import_source = null)
{
$result="";
return $result;
}
function _syncconf_listBy()
{
$ar=array();
return $ar;
}
function _syncconf_list()
{
$ar=array();
return $ar;
}
As you see, we don't return anything useful. These functions always return an empty result - an empty string or an empty array. But that will do the trick!
Save that file as "....horde/syncconf/lib/api.php" and you have your superb new API! (returning nothing, wha whaaaaa).
Now make a fake configuration (Horde DOES WANT a configuration! No chance if you don't have one). Create file conf.php as ....horde/syncconf/config/conf.php:
<?php
$conf['syncconf']['looking_for_nice_woman_to_make_family'] = true;
put in whatever you want.
You may omit the last "?>" as all included Horde files do. I am just accomodating to their style.
Now it is time to register this "application" - hey we don't even have a user interface - all we have is a dumb api and a nonsense config. So we have to insert this in ....horde/config/registry.php (the Horde application registry):
$this->applications['syncconf'] = array(
'fileroot' => dirname(__FILE__) . '/../syncconf',
'name' => 'Funambol Configuration',
'status' => 'hidden',
'provides' => array('configuration/listBy','configuration/list','configuration/import')
);
Please make sure that the status is 'hidden' otherwise Horde will have some big problem...
Last, define "configuration" as valid SyncML database name. Unfortunately, there is not a small configuration file to achieve this, no, you have to patch Backend.php and Backend/Sql.php (real paths described above).
In ....horde/lib/SyncML/Backend.php you'll find these lines:
function isValidDatabaseURI($databaseURI)
{
$database = $this->_normalize($databaseURI);
switch($database) {
case 'tasks';
case 'calendar';
case 'notes';
case 'contacts';
case 'configuration';
return true;
Note I just added "case 'configuration';" to the switch statement.
The same applies to ....horde/lib/SyncML/Backend/Sql.php:
function isValidDatabaseURI($databaseURI)
{
$database = $this->_normalize($databaseURI);
switch($database) {
case 'tasks';
case 'calendar';
case 'notes';
case 'contacts';
case 'configuration';
case 'events':
case 'memo':
return true;
Same trick as above: I just inserted "case 'configuration';".
Now you're ready to run.
The SyncML server URL is just
https://your_horde_server/horde/rpc.php
I used an Apache Alias statement to change this to
https://our_horde_site/sync
And it works.
Please make sure that neither "E-Mail" nor "Briefcase" are selecedt in the PIM settings of the Funambol Client. These won't work.
Just use normal IMAP4 account data for Windows Mobile Messaging to get your email on your phone/mobile device.
Mission accomplished.
Yes, I hate PHP.
But Horde is quite cool.

Interesting post, thanks!
Actually, the WinMobile client is supposed to work even if the config sync source is not available on the server, so what you reported is actually a bug.
You may want to report this also on the Funambol tracker or mailing list, so that it can be scheduled for being fixed.
Andrea
As there are some issues between outlook/symbian/xxx events/contacts format, using horde as a syncml server can prevent some events/contacts to sync... anyway it could be a nice solution for a non enterprise environment (imho).
Nice post anyway!
Thanks for the great post.. previously i manage to sync Horde webmail with windows mobile using funambol-pocketpc-plugin-6.5.18.cab ... by pointing the URL in client to http://mailserver/rpc.php
It can sync the calendar, task, note and contact ..
Maybe i can try your solution soon .. thanks again ..
This workaround is needed for Funambol clients 7.x and 8.0.4, at the time being.
Funambol
Brilliant post. Thank you.
The proposed fix on horde doesn't work anymore in latest version, because the conf.php file format changed a bit.
This is what I've put in that file:
Please notice no "?>" at end.
Anyway, I still think that Funambol's actions ("refusing to sync if it's not Funambol server") doesn't fit with the opensource/standard advertisement they are doing. I hope it won't become another "open source" lockware
i already to the above and changes to conf.php then i get wrong username n password ..
i cant leave the password blank to clik "OK"
so glad to see that it really works! this was especially desirable for me cause I use both Funambol and Horde for business. with Funambol I can integrate email features and functions. surprised that it is so easy.