Denis Gomes Franco
Regular Pleskian
I'd like to share a quick and dirty hack that I used to brand my customers' Roundcube interface (now that it is running on v1.4) with their own logos. It was a fun little project and they absolutely loved it. With this, the customer will see their own logo on the login page and on the top left corner of the webmail interface.
Roundcube kinda allows for per-domain configuration but I figured this type of customization could be done without this. Here's what I did:
1. Created a "branding" directory inside /usr/share/psa-roundcube/ (or wherever your Roundcube instance is installed)
2. Uploaded customers logos to that directory. Files should be in PNG format with a square aspect ratio, and their names should be the same as the subdomain where Roundcube runs, eg., if the access URL is "webmail.mysupercompany.com" the file should be named "webmail.mysupercompany.com.png". You can upload logos for all your domains to that directory.
3. Added the following lines to /usr/share/psa-roundcube/config/config.inc.php:
Note that the above code is referencing a placeholder.png file. You should also upload a placeholder logo under that name, as it will be used instead whenever there is no custom logo present for a domain, or when you don't want to brand a particular domain. This configuration will override the Elastic skin default logo, and I am using my company logo as a placeholder. But if you'd like to use the default Elastic skin logo then just delete that line and the ELSE condition right above it.
Hope that helps! For me it works just like a charm
Roundcube kinda allows for per-domain configuration but I figured this type of customization could be done without this. Here's what I did:
1. Created a "branding" directory inside /usr/share/psa-roundcube/ (or wherever your Roundcube instance is installed)
2. Uploaded customers logos to that directory. Files should be in PNG format with a square aspect ratio, and their names should be the same as the subdomain where Roundcube runs, eg., if the access URL is "webmail.mysupercompany.com" the file should be named "webmail.mysupercompany.com.png". You can upload logos for all your domains to that directory.
3. Added the following lines to /usr/share/psa-roundcube/config/config.inc.php:
PHP:
$logo_cliente = $_SERVER['SERVER_NAME'] . '.png';
if (file_exists('./branding/' . $logo_cliente)) {
$config['skin_logo'] = '../../branding/' . $logo_cliente;
} else {
$config['skin_logo'] = '../../branding/placeholder.png';
}
Note that the above code is referencing a placeholder.png file. You should also upload a placeholder logo under that name, as it will be used instead whenever there is no custom logo present for a domain, or when you don't want to brand a particular domain. This configuration will override the Elastic skin default logo, and I am using my company logo as a placeholder. But if you'd like to use the default Elastic skin logo then just delete that line and the ELSE condition right above it.
Hope that helps! For me it works just like a charm
Last edited: