सामग्री पर जाएँ
Email Servers

Brand Roundcube Webmail per Domain on a Shared Mail Server

Put one PNG per webmail hostname in a branding folder, then set skin_logo in config.inc.php from $_SERVER['SERVER_NAME'] with a placeholder fallback.

परखा गया Roundcube 1.6, Elastic skin

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

Terminal
sudo mkdir -p /var/www/roundcube/branding

Adjust 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:

Files
/var/www/roundcube/branding/webmail.customer-a.com.pngn/var/www/roundcube/branding/mail.customer-b.com.pngn/var/www/roundcube/branding/placeholder.png

Step 3 – Choose the logo in config.inc.php

Terminal
sudo nano /var/www/roundcube/config/config.inc.php

Add:

config.inc.php
// 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.

Inder Kochar

लेखक

Inder Kochar

सिस्टम्स और नेटवर्क इंजीनियर – मैं वही समाधान लिखता हूँ जो क्लाइंट्स के साथ इस्तेमाल करता हूँ, असली सिस्टम पर परखे हुए। ऐसी ही किसी समस्या में फँसे हैं?

आगे पढ़ें

सवाल पूछें या अपना समाधान बताएँ

आपका ईमेल प्रकाशित नहीं होगा। टिप्पणियाँ जाँची जाती हैं – कृपया विषय से जुड़ी रखें।