diff -urN courier_vacation/config.php.sample courier_vacation.olo/config.php.sample
--- courier_vacation/config.php.sample	2003-04-29 09:43:32.000000000 +0200
+++ courier_vacation.olo/config.php.sample	2003-12-05 14:07:09.000000000 +0100
@@ -44,9 +44,10 @@
 
 
    // this setting determines where your user settings are 
-   // stored.  currently, only MySQL is supported, although
+   // stored.  currently, only MySQL and LDAP is supported, although
    // that could change...
    //
+   //$backend = 'ldap';
    $backend = 'mysql';
 
 
@@ -89,5 +90,30 @@
    //
    $mysql_userid_field = 'userid';
 
+   //
+   // LDAP settings
+   //
+
+   // your LDAP server
+   //
+   $ldap_server = 'localhost';
+   $ldap_port = 389;
+   $ldap_basedn = 'dc=example,dc=com';
+
+   // the LDAP bind DN
+   //
+   $ldap_user = 'cn=Manager,dc=example,dc=com';
+
+   // the LDAP password
+   //
+   $ldap_pwd = 'secret';
+
+   // the LDAP attribute that contains users' home directory locations
+   //
+   $ldap_home_attr = 'homeDirectory';
+
+   // the LDAP attribute that contains users' IDs
+   //
+   $ldap_userid_attr = 'uid';
 
 ?>
diff -urN courier_vacation/options.php courier_vacation.olo/options.php
--- courier_vacation/options.php	2003-08-29 07:32:00.000000000 +0200
+++ courier_vacation.olo/options.php	2003-12-05 14:03:43.000000000 +0100
@@ -585,6 +585,54 @@
 
 }
 
+// get user's home directory from a LDAP backend
+//
+
+function ldap_get_home_directory($user)
+{
+
+   global $ldap_server, $ldap_port, $ldap_basedn, $ldap_user, $ldap_pwd,
+          $ldap_home_attr, $ldap_userid_attr;
+
+
+   $ds = ldap_connect($ldap_server, $ldap_port);
+   if (!$ds) 
+   {
+      showError('ERROR: Could not connect to LDAP');
+      exit(1);
+   }
+
+   if (!ldap_bind($ds, $ldap_user, $ldap_pwd)) 
+   {
+      showError('ERROR: Could not bind to LDAP after connecting. Check user DN and password.');
+      exit(1);
+   }
+
+   // Filter out invalid characters from uid:
+   $user = preg_replace('[^a-zA-Z0-9._-]', '',$user);
+   $query_string = "(uid=$user)";
+   $return_attributes = array($ldap_home_attr);
+	 $search_result = ldap_search($ds, $ldap_basedn, $query_string, $return_attributes);
+
+    
+   if (!$search_result) 
+   {
+      showError('ERROR: LDAP search failed');
+      exit(1);
+   }
+
+   if (ldap_count_entries($ds, $search_result) != 1) 
+   {
+      showError('ERROR: Could not fetch correct user info');
+      exit(1);
+   }
+
+   // after all that...  get results
+   //
+   $entries = ldap_get_entries($ds, $search_result);
+   return $entries[0][strtolower($ldap_home_attr)][0];
+
+}
 
 
 ?>
