--- installer/config.php.orig	2008-06-16 12:42:39.000000000 -0400
+++ installer/config.php
@@ -23,7 +23,7 @@ $_SESSION['allowinstaller'] = true;
 if (!empty($_POST['submit'])) {
   
   echo '<p class="notice">Copy the following configurations and save them in two files (names above the text box)';
-  echo ' within the <tt>config/</tt> directory of your RoundCube installation.<br/>';
+  echo ' within the <tt>'.RCMAIL_CONFIG_DIR.'/</tt> directory of your RoundCube installation.<br/>';
   echo ' Make sure that there are no characters outside the <tt>&lt;?php ?&gt;</tt> brackets when saving the files.</p>';
   
   $textbox = new html_textarea(array('rows' => 16, 'cols' => 60, 'class' => "configfile"));
--- installer/index.php.orig	2008-06-16 12:42:39.000000000 -0400
+++ installer/index.php
@@ -59,7 +59,7 @@ function __autoload($classname)
   if ($RCI->configured && !$RCI->getprop('enable_installer') && !$_SESSION['allowinstaller']) {
     // header("HTTP/1.0 404 Not Found");
     echo '<h2 class="error">The installer is disabled!</h2>';
-    echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in config/main.inc.php</p>';
+    echo '<p>To enable it again, set <tt>$rcmail_config[\'enable_installer\'] = true;</tt> in '.RCMAIL_CONFIG_DIR.'/main.inc.php</p>';
     echo '</div></body></html>';
     exit;
   }
--- installer/rcube_install.php.orig	2008-05-05 02:48:39.000000000 -0400
+++ installer/rcube_install.php
@@ -79,12 +79,12 @@ class rcube_install
    */
   function _load_config($suffix)
   {
-    @include '../config/main.inc' . $suffix;
+    @include RCMAIL_CONFIG_DIR . '/main.inc' . $suffix;
     if (is_array($rcmail_config)) {
       $this->config += $rcmail_config;
     }
       
-    @include '../config/db.inc'. $suffix;
+    @include RCMAIL_CONFIG_DIR . '/db.inc'. $suffix;
     if (is_array($rcmail_config)) {
       $this->config += $rcmail_config;
     }
--- installer/test.php.orig	2008-04-12 09:54:45.000000000 -0400
+++ installer/test.php
@@ -3,8 +3,8 @@
 <h3>Check config files</h3>
 <?php
 
-$read_main = is_readable(INSTALL_PATH.'config/main.inc.php');
-$read_db = is_readable(INSTALL_PATH.'config/db.inc.php');
+$read_main = is_readable(RCMAIL_CONFIG_DIR.'/main.inc.php');
+$read_db = is_readable(RCMAIL_CONFIG_DIR.'/db.inc.php');
 
 if ($read_main && !empty($RCI->config)) {
   $RCI->pass('main.inc.php');
--- program/include/iniset.php.orig	2008-06-09 16:57:53.000000000 -0400
+++ program/include/iniset.php
@@ -30,6 +30,9 @@ if (!defined('INSTALL_PATH')) {
   define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
 }
 
+// define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
+define('RCMAIL_CONFIG_DIR', '@PKG_SYSCONFDIR@');
+
 // make sure path_separator is defined
 if (!defined('PATH_SEPARATOR')) {
   define('PATH_SEPARATOR', (eregi('win', PHP_OS) ? ';' : ':'));
--- program/include/rcmail.php.orig	2008-06-07 15:33:07.000000000 -0400
+++ program/include/rcmail.php
@@ -410,7 +410,7 @@ class rcmail
       raise_error(array(
         'code' => 600,
         'type' => 'php',
-        'file' => "config/main.inc.php",
+        'file' => RCMAIL_CONFIG_DIR."/main.inc.php",
         'message' => "Acces denied for new user $username. 'auto_create_user' is disabled"
         ), true, false);
     }
--- program/include/rcube_config.php.orig	2008-05-15 16:05:20.000000000 -0400
+++ program/include/rcube_config.php
@@ -50,11 +50,11 @@ class rcube_config
     ob_start();
     
     // load main config file
-    include_once(INSTALL_PATH . 'config/main.inc.php');
+    include_once(RCMAIL_CONFIG_DIR . '/main.inc.php');
     $this->prop = (array)$rcmail_config;
 
     // load database config
-    include_once(INSTALL_PATH . 'config/db.inc.php');
+    include_once(RCMAIL_CONFIG_DIR . '/db.inc.php');
     $this->prop += (array)$rcmail_config;
     
     // load host-specific configuration
@@ -103,8 +103,8 @@ class rcube_config
       $fname = preg_replace('/[^a-z0-9\.\-_]/i', '', $_SERVER['HTTP_HOST']) . '.inc.php';
     }
 
-    if ($fname && is_file(INSTALL_PATH . 'config/' . $fname)) {
-      include(INSTALL_PATH . 'config/' . $fname);
+    if ($fname && is_file(RCMAIL_CONFIG_DIR . '/' . $fname)) {
+      include(RCMAIL_CONFIG_DIR . '/' . $fname);
       $this->prop = array_merge($this->prop, (array)$rcmail_config);
     }
   }
