Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ REDIS_SERVER='127.0.0.1'
REDIS_PORT=6379
REDIS_INDEX=1
REDIS_PASS=
REDIS_SOCKET=/var/run/redis/redis-server.sock
REDIS_SOCKET=

ENABLE_MEMCACHED=true
MEMCACHED_SERVER='127.0.0.1'
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@

'redis_pass' => env('REDIS_PASS'),

'redis_socket' => env('REDIS_SOCKET', '/var/run/redis/redis-server.sock'),
'redis_socket' => env('REDIS_SOCKET', ''),

/*
| -----------------
Expand Down
24 changes: 14 additions & 10 deletions modules/imap/handler_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,13 +650,25 @@ public function process() {
$folder = $this->request->post['folder'];
}
$path = sprintf("imap_%s_%s", $form['imap_server_id'], $folder);
$page_cache = $this->cache->get('imap_folders_'.$path);
$with_subscription = isset($this->request->post['subscription_state']) && $this->request->post['subscription_state'];

if (array_key_exists('imap_prefetch', $this->request->post)) {
$prefetched = $this->session->get('imap_prefetched_ids', array());
$prefetched[] = $form['imap_server_id'];
$this->session->set('imap_prefetched_ids', array_unique($prefetched, SORT_STRING));
}
$with_subscription = isset($this->request->post['subscription_state']) && $this->request->post['subscription_state'];

// Check cache FIRST before connecting to IMAP
$page_cache = $this->cache->get('imap_folders_'.$path);
if ($page_cache) {
$this->out('imap_expanded_folder_data', $page_cache);
$this->out('imap_expanded_folder_id', $form['imap_server_id']);
$this->out('imap_expanded_folder_path', $path);
$this->out('with_input', $with_subscription);
$this->out('folder', $folder);
return;
}

$mailbox = Hm_IMAP_List::get_connected_mailbox($form['imap_server_id'], $this->cache);
if ($mailbox && $mailbox->authed()) {
$this->out('can_share_folders', stripos($mailbox->get_capability(), 'ACL') !== false);
Expand All @@ -673,14 +685,6 @@ public function process() {
}
}
}
if ($page_cache) {
$this->out('imap_expanded_folder_data', $page_cache);
$this->out('imap_expanded_folder_id', $form['imap_server_id']);
$this->out('imap_expanded_folder_path', $path);
$this->out('with_input', $with_subscription);
$this->out('folder', $folder);
return;
}
if ($mailbox && $mailbox->authed()) {
$only_subscribed = $this->user_config->get('only_subscribed_folders_setting', false);
if ($with_subscription) {
Expand Down