Could someone have a look at:

http://trac.roundcube.net/ticket/1486701

It's marked closed, but I submitted some patches in it.