From 91ac83e82f3995213eabc29c8ab406b726f0f497 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 31 Mar 2015 07:53:03 -0400
Subject: [PATCH] Fix zipped messages downloads after selecting all messages in a folder (#1490339)

---
 CHANGELOG                           |    1 +
 plugins/zipdownload/zipdownload.php |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index c304280..9ae931c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,7 @@
 ===========================
 
 - Fix handling of %-encoded entities in mailto: URLs (#1490346)
+- Fix zipped messages downloads after selecting all messages in a folder (#1490339)
 
 RELEASE 1.1.1
 -------------
diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php
index 2e103ce..983db12 100644
--- a/plugins/zipdownload/zipdownload.php
+++ b/plugins/zipdownload/zipdownload.php
@@ -211,6 +211,11 @@
             $imap->set_folder($mbox);
             $path = $folders ? str_replace($imap->get_hierarchy_delimiter(), '/', $mbox) . '/' : '';
 
+            if ($uids === '*') {
+                $index = $imap->index($mbox, null, null, true);
+                $uids  = $index->get();
+            }
+
             foreach ($uids as $uid) {
                 $headers = $imap->get_message_headers($uid);
 

--
Gitblit v1.9.1