I found a problem with resolving username from email in function email2user (rcube_user.php). This function only resolves strict aliases like
user@example.com realuser
Especially, does not support %1 substitution and aliasing to another e-mail. By example, below entries aren't proprerly resolved.
user@example.com otheruser@expamle.com otheruser@expamle.com realuser
don't work for user@example.com
or
user@example.com realuser @another.domain %1@example.com
don't work for user@another.domain
I wrote a quick patch, that allow recursion in virtusertable processing and doing %1 substitution. In addition, enrties "cathall" like
@example.com user
ale supported.
This patch works for me, but are a rether non-optimal because i don't change anything in findinvirtual() function, and virtusertable is readed in every recursion. This can be fixed easyly by caching $virtual array.