diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-07-28 19:03:16 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-07-28 19:03:16 +0200 |
commit | e1567419411fbd56a3f3ac5f0a805b1e345fa0cc (patch) | |
tree | d468765a4ff9f5e9b065247e36158e3321ed20c4 /program/lib/Roundcube | |
parent | 85f14674316387d08fa11221de340c71835c4fa3 (diff) |
Fix bug where $Forwarded flag was being set even if server didn't support it (#1490000)
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r-- | 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 d76014f89..a43dfeeed 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -2028,10 +2028,6 @@ class rcube_imap_generic */ protected function modFlag($mailbox, $messages, $flag, $mod = '+') { - if ($mod != '+' && $mod != '-') { - $mod = '+'; - } - if (!$this->select($mailbox)) { return false; } @@ -2041,12 +2037,25 @@ class rcube_imap_generic 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); |