From 057444bd415a3b0fef503f88f44d29b95e50d64d Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 28 Jul 2014 13:03:55 -0400
Subject: [PATCH] Fix bug where $Forwarded flag was being set even if server didn't support it (#1490000)
---
program/lib/Roundcube/rcube_imap_generic.php | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 7094330..f465ac1 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -1964,10 +1964,6 @@
*/
private function modFlag($mailbox, $messages, $flag, $mod = '+')
{
- if ($mod != '+' && $mod != '-') {
- $mod = '+';
- }
-
if (!$this->select($mailbox)) {
return false;
}
@@ -1977,12 +1973,25 @@
return false;
}
+ if ($this->flags[strtoupper($flag)]) {
+ $flag = $this->flags[strtoupper($flag)];
+ }
+
+ if (!$flag || !in_array($flag, (array) $this->data['PERMANENTFLAGS'])
+ || !in_array('\\*', (array) $this->data['PERMANENTFLAGS'])
+ ) {
+ return false;
+ }
+
// Clear internal status cache
if ($flag == 'SEEN') {
unset($this->data['STATUS:'.$mailbox]['UNSEEN']);
}
- $flag = $this->flags[strtoupper($flag)];
+ if ($mod != '+' && $mod != '-') {
+ $mod = '+';
+ }
+
$result = $this->execute('UID STORE', array(
$this->compressMessageSet($messages), $mod . 'FLAGS.SILENT', "($flag)"),
self::COMMAND_NORESPONSE);
--
Gitblit v1.9.1