Index: /trunk/roundcubemail/CHANGELOG
===================================================================
--- /trunk/roundcubemail/CHANGELOG	(revision 4788)
+++ /trunk/roundcubemail/CHANGELOG	(revision 4789)
@@ -2,4 +2,5 @@
 ===========================
 
+- Fix default_port option handling in Installer when config.inc.php file exists (#1487925)
 - Removed option focus_on_new_message, added newmail_notifier plugin
 - Added general rcube_cache class with Memcache and APC support
Index: /trunk/roundcubemail/installer/index.php
===================================================================
--- /trunk/roundcubemail/installer/index.php	(revision 4788)
+++ /trunk/roundcubemail/installer/index.php	(revision 4789)
@@ -42,5 +42,5 @@
   header('Content-type: text/plain');
   header('Content-Disposition: attachment; filename="'.$filename.'"');
-  
+
   $RCI->merge_config();
   echo $RCI->create_config($_GET['_mergeconfig'], true);
Index: /trunk/roundcubemail/installer/rcube_install.php
===================================================================
--- /trunk/roundcubemail/installer/rcube_install.php	(revision 4788)
+++ /trunk/roundcubemail/installer/rcube_install.php	(revision 4789)
@@ -124,6 +124,6 @@
     return $value !== null && $value !== '' ? $value : $default;
   }
-  
-  
+
+
   /**
    * Take the default config file and replace the parameters
@@ -136,11 +136,12 @@
   {
     $out = @file_get_contents(RCMAIL_CONFIG_DIR . "/{$which}.inc.php.dist");
-    
+
     if (!$out)
       return '[Warning: could not read the config template file]';
 
     foreach ($this->config as $prop => $default) {
+
       $value = (isset($_POST["_$prop"]) || $this->bool_config_props[$prop]) ? $_POST["_$prop"] : $default;
-      
+
       // convert some form data
       if ($prop == 'debug_level') {
@@ -194,7 +195,7 @@
         $value = intval($value);
       }
-      
+
       // skip this property
-      if (!$force && ($value == $default))
+      if (!$force && !$this->configured && ($value == $default))
         continue;
 
