From b07a5e539f791677986e87fa96b26fcabbd76e55 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 6 Oct 2017 09:23:17 +0200 Subject: [PATCH] Fix so untagged COPYUID responses are also supported according to RFC6851 (#5982) --- CHANGELOG | 1 + program/lib/Roundcube/rcube_imap_generic.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c89908c80..9eb3bc494 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ CHANGELOG Roundcube Webmail - Fix (again) bug where image data URIs in css style were treated as evil/remote in mail preview (#5580) - Fix bug where mail search could return empty result on servers without SORT capability (#5973) - Fix bug where assets_path wasn't added to some watermark frames +- Fix so untagged COPYUID responses are also supported according to RFC6851 (#5982) RELEASE 1.3.1 ------------- diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index 05c43a1ef..685e694b9 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -3727,9 +3727,17 @@ class rcube_imap_generic // Parse response do { $line = $this->readLine(4096); + if ($response !== null) { $response .= $line; } + + // parse untagged response for [COPYUID 1204196876 3456:3457 123:124] (RFC6851) + if ($line && $command == 'UID MOVE' && substr_compare($line, '* OK', 0, 4, true)) { + if (preg_match("/^\* OK \[COPYUID [0-9]+ ([0-9,:]+) ([0-9,:]+)\]/i", $line, $m)) { + $this->data['COPYUID'] = array($m[1], $m[2]); + } + } } while (!$this->startsWith($line, $tag . ' ', true, true));