diff --git a/modules/imap/handler_modules.php b/modules/imap/handler_modules.php index 5f8e0d301d..37bdfba981 100644 --- a/modules/imap/handler_modules.php +++ b/modules/imap/handler_modules.php @@ -1564,12 +1564,12 @@ public function process() { if (! empty($auth_server['sieve_config_host'])) { $imap_details['sieve_config_host'] = $auth_server['sieve_config_host']; } - } - if (!$default_server_id) { - Hm_IMAP_List::add($imap_details); - } else { - // Perhaps something as changed - Hm_IMAP_List::edit($default_server_id, $imap_details); + if (!$default_server_id) { + Hm_IMAP_List::add($imap_details); + } else { + // Perhaps something as changed + Hm_IMAP_List::edit($default_server_id, $imap_details); + } } } } diff --git a/tests/phpunit/config.php b/tests/phpunit/config.php index 8ef3d0de1f..550b6a0df6 100644 --- a/tests/phpunit/config.php +++ b/tests/phpunit/config.php @@ -41,7 +41,7 @@ public function test_filter_servers() { $this->assertEquals(array('imap_servers' => array(array())), $this->config->filter_servers()); $this->config->set('imap_servers', array(array('default' => 1, 'server' => 'localhost'))); - $this->assertEquals(array('imap_servers' => array(array('default' => 1, 'server' => 'localhost'))), $this->config->filter_servers()); + $this->assertEquals(array(), $this->config->filter_servers()); $this->config->set('imap_servers', array(array('pass' => 'foo', 'server' => 'localhost'))); $this->config->set('no_password_save_setting', true);