To cut a long story short. I needed to get Roundcube webmail to work with a HTTPS/SSL reverse proxy. I wrote a patch because it dosen't work out of the box.
Any suggestions are welcome.
// to enable connections over a reverse proxy specify a host
// adjust the path and set $rcmail_config['force_https'] to true
// you will be redirected to https:// rproxy_host . rproxy_path . $_SERVER['REQUEST_URI']
$rcmail_config['rproxy_host'] = null; // eg. 'ssl-account.com'
$rcmail_config['rproxy_path'] = null; // eg. 'app.my-domain.com'
links: