Skip to content

Commit 893c557

Browse files
authored
Backport virtuser file email2user fix (#9691)
* Merge pull request #9668 from idressos/virtuser_file-email2user-fix Fix virtuser_file plugin email2user() function not accounting for backward slashes in username Cherry-picked from 875e370 (parent mainline 1). * Changelog entry for #9668 (cherry picked from commit a07d61a)
1 parent a68ef05 commit 893c557

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- Fix current script state after initial scripts creation in managesieve_kolab_master mode
99
- Fix rcube_imap::get_vendor() result (and PHP warning) on Zimbra server (#9650)
1010
- Fix regression causing inline SVG images to be missing in mail preview (#9644)
11+
- Fix plugin "virtuser_file" to handle backward slashes in username (#9668)
1112

1213
## Release 1.6.9
1314

plugins/virtuser_file/virtuser_file.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ function email2user($p)
6767
$arr = preg_split('/\s+/', trim($r[$i]));
6868

6969
if (count($arr) > 0) {
70-
$p['user'] = trim($arr[count($arr)-1]);
70+
// Replace '\@' with '@' to handle cases where internal usernames include an '@' character.
71+
// Sometimes usernames with '@' are saved with a leading '\' to avoid conflicts.
72+
$p['user'] = trim(str_replace('\@', '@', $arr[count($arr) - 1]));
7173
break;
7274
}
7375
}

0 commit comments

Comments
 (0)