Skip to content

Commit

Permalink
Fix handling of mail parts that are encoded with x-uuencode (#9096)
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Aug 12, 2023
1 parent efad759 commit dfa18ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- Fix regression where LDAP addressbook 'filter' option was ignored (#9061)
- Fix wrong order of a multi-folder search result when sorting by size (#9065)
- Fix so install/update scripts do not require PEAR (#9037)
- Fix handling of mail parts that are encoded with x-uuencode (#9096)

## Release 1.6.2

Expand Down
10 changes: 6 additions & 4 deletions program/lib/Roundcube/rcube_imap_generic.php
Original file line number Diff line number Diff line change
Expand Up @@ -3004,10 +3004,12 @@ public function handlePartBody($mailbox, $id, $is_uid = false, $part = '', $enco
}
// UUENCODE
else if ($mode == 3) {
$line = rtrim($line, "\t\r\n\0\x0B");
if ($line == 'end' || preg_match('/^begin\s+[0-7]+\s+.+$/', $line)) {
continue;
}
$line = preg_replace(
['/\r?\n/', '/\nend$/', '/^begin\s+[0-7]{3}\s+[^\n]+\n/'],
["\n", '', ''],
$line
);

$line = convert_uudecode($line);
}
// default
Expand Down

0 comments on commit dfa18ab

Please sign in to comment.