When one server hosts mail for several businesses, each customer should see their own brand on the webmail login page – not yours. Roundcube can switch the logo automatically based on the hostname the user visits, such as webmail.customer-a.com or mail.customer-b.com.
Step 1 – Create a branding folder
sudo mkdir -p /var/www/roundcube/brandingAdjust the path if Roundcube is installed elsewhere.
Step 2 – Add one logo per webmail hostname
Upload a PNG for each domain, named exactly after the hostname users visit, plus a default:
/var/www/roundcube/branding/webmail.customer-a.com.pngn/var/www/roundcube/branding/mail.customer-b.com.pngn/var/www/roundcube/branding/placeholder.pngStep 3 – Choose the logo in config.inc.php
sudo nano /var/www/roundcube/config/config.inc.phpAdd:
// Per-domain logo: branding/u003chostnameu003e.png, else placeholder.pngn$host = preg_replace( '/[^a-z0-9.-]/', '', strtolower( $_SERVER['SERVER_NAME'] ?? '' ) );n$logo = $host . '.png';nif ( $host u0026u0026 file_exists( __DIR__ . '/../branding/' . $logo ) ) {n $config['skin_logo'] = '../../branding/' . $logo;n} else {n $config['skin_logo'] = '../../branding/placeholder.png';n}The hostname is sanitised before it is used in a file path, so a crafted Host header can’t point Roundcube at other files.
Step 4 – Test
Open each webmail address in a private window – the login page shows that customer’s logo, and unknown hostnames fall back to the placeholder.
Recent Roundcube versions
Roundcube 1.5+ also accepts per-skin and per-template logos as an array, e.g. $config['skin_logo'] = [ 'elastic:login' => '…', '*' => '…' ];. Combine it with the hostname logic above if you want a different login-page logo.

