diff --git a/CHANGELOG b/CHANGELOG index 165801f93..c1a098f8f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ CHANGELOG Roundcube Webmail - Fix rewind(): stream does not support seeking (#5950) - Fix bug where HTML messages could have been rendered empty on some systems (#5957) - Fix (again) bug where image data URIs in css style were treated as evil/remote in mail preview (#5580) +- Managesieve: Fix parsing dot-staffed lines in multiline text (#5838, #5959) RELEASE 1.2.6 ------------- diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 5e6f39267..948f3b7ff 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,3 +1,4 @@ +- Fix parsing dot-staffed lines in multiline text (#5838) - Fix handling of scripts with nested rules (#5540) - Fix possible defect in handling \r\n in scripts (#5685) diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php index 8efc46daa..980cab446 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php @@ -1231,11 +1231,13 @@ class rcube_sieve_script $text .= substr($str, $position, $pos - $position); $position = $pos + 2; - if ($str[$pos] == "\n" - || ($str[$pos] == "\r" && $str[$pos + 1] == "\n") + if ($str[$position] == "\n" + || ($str[$position] == "\r" && $str[$position + 1] == "\n") ) { break; } + + $text .= "\n."; } // remove dot-stuffing diff --git a/plugins/managesieve/tests/src/parser_vacation b/plugins/managesieve/tests/src/parser_vacation index 93026db45..8603d37c4 100644 --- a/plugins/managesieve/tests/src/parser_vacation +++ b/plugins/managesieve/tests/src/parser_vacation @@ -5,6 +5,8 @@ if header :contains "Subject" "vacation" vacation :days 1 text: # test test test /* test */ +.. +..test test . ;