summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--program/lib/Roundcube/rcube_imap_generic.php10
2 files changed, 10 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b3d37ffb6..adba207f2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
CHANGELOG Roundcube Webmail
===========================
+- Fix setting flags on servers with no PERMANENTFLAGS response (#1490087)
+
RELEASE 1.0.3
-------------
- Fix insert-signature command in external compose window if opened from inline compose screen (#1490074)
diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php
index 4809c8b11..2690cbd5a 100644
--- a/program/lib/Roundcube/rcube_imap_generic.php
+++ b/program/lib/Roundcube/rcube_imap_generic.php
@@ -2002,8 +2002,14 @@ class rcube_imap_generic
$flag = $this->flags[strtoupper($flag)];
}
- if (!$flag || (!in_array($flag, (array) $this->data['PERMANENTFLAGS'])
- && !in_array('\\*', (array) $this->data['PERMANENTFLAGS']))
+ if (!$flag) {
+ return false;
+ }
+
+ // if PERMANENTFLAGS is not specified all flags are allowed
+ if (!empty($this->data['PERMANENTFLAGS'])
+ && !in_array($flag, (array) $this->data['PERMANENTFLAGS'])
+ && !in_array('\\*', (array) $this->data['PERMANENTFLAGS'])
) {
return false;
}