• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question how to preserve custom roundcube configuration between plesk updates or mail reconfigurations

johnrdorazio

Basic Pleskian
I have successfully configured roundcube for multiple domains on an ovh VPS where I have 4 running websites, each with it's own domain, by editing /usr/share/psa-roundcube/config/defaults.inc.php . However every time plesk updates or reconfigures mail services, this configuration file is automatically reconfigured and I lose access to my webmail unless I go through and manually edit the configurations again. I have made a backup copy of my configurations to make sure I don't lose them but it is a little frustrating to have to do this every time there is an update. Is there a way to override this file, perhaps with a file in /opt/psa/admin/conf/templates/custom/webmail ?
 
Can I find out why you needed to configure the file /usr/share/psa-roundcube/config/defaults.inc.php manually and why the default RoundCube webmail settings for domains and their mailboxes provided by Plesk does not suit you?
 
Can I find out why you needed to configure the file /usr/share/psa-roundcube/config/defaults.inc.php manually and why the default RoundCube webmail settings for domains and their mailboxes provided by Plesk does not suit you?
I don't know about @johnrdorazio, but I had to write a script that checks the settings in the file and "fixes" them if they are changed by an update. It runs via cron job early every morning. It would be nice to have a GUI settings page for all of the possible settings for admins.

I wanted to change things like this list:

PCS Branding: $config['product_name'] = 'PCS Web Hosting LLC';
Identity Settings: $config['identities_level'] = 3;
Refresh Settings: $config['refresh_interval'] = 300;
Mail List Size Settings: $config['mail_pagesize'] = 100;
Minimum Refresh Settings: $config['min_refresh_interval'] = 120;
Display Name Settings: $config['message_show_email'] = true;
Signature Placement Settings: $config['sig_below'] = true;
Compose HTML Settings: $config['htmleditor'] = 4;
Message Sort Settings: $config['message_sort_col'] = 'arrival';
Preview Pane Settings: $config['layout'] = 'desktop';
Sendmail Delay Settings: $config['sendmail_delay'] = 5;
Autosave Draft Settings: $config['draft_autosave'] = 600;
Max Recipients Settings: $config['max_recipients'] = 300;
Reply Mode Settings: $config['reply_mode'] = 1;
Login Autocomplete Settings: $config['login_autocomplete'] = 2;
Trash Deletion Settings: $config['delete_always'] = true;

Some are just defaults that a user can set to their own specs, but others helps the server load and branding.
 
Can I find out why you needed to configure the file /usr/share/psa-roundcube/config/defaults.inc.php manually and why the default RoundCube webmail settings for domains and their mailboxes provided by Plesk does not suit you?
Because as I said I have a multi-domain setup with branding for each domain, and I am using certificates not only for the webmail domains but also for the imap and pop3 connections. Plus I have a number of preferences (such as html editor by default, or branding for the different domains) similarly to @GJPiiper .

Here are my working configs (only those that are different from the default config):

$config['default_host'] = 'tls://%t';
// TCP port used for IMAP connections
$config['default_port'] = 143;

// IMAP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or null to use
// best server supported one)
$config['imap_auth_type'] = null;

// IMAP socket context options
// See PHP: SSL context options - Manual
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed' => true,
'peer_name' => 'mybasedomain.com',
'ciphers' => 'TLSv1+HIGH:!aNull:mad:STRENGTH',
'cafile' => '/etc/ssl/certs/cacert.pem'
),
);

$config['imap_cache'] = 'db';
$config['messages_cache'] = 'db';

// ----------------------------------
// SMTP
// ----------------------------------

$config['smtp_server'] = 'tls://%t';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 587;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$config['smtp_auth_type'] = '';
_______________________________________________________________________
// SMTP socket context options
// See PHP: SSL context options - Manual
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed' => true,
'peer_name' => 'mybasedomain.com',
'ciphers' => 'TLSv1+HIGH:!aNull:mad:STRENGTH',
'cafile' => '/etc/ssl/certs/cacert.pem'
),
);
_______________________________________________________________________

$config['force_https'] = true;
$config['use_https'] = false;

$config['login_autocomplete'] = 2;

$config['display_version'] = true;

$config['session_lifetime'] = 180;

$config['username_domain'] = '%t';

$config['username_domain_forced'] = true;

$config['mail_domain'] = '%t';

$config['password_charset'] = 'UTF-8';

$config['product_name'] = "Webmail offered by [my brand name] ";

$config['include_host_config'] = array(
'webmail.myfirstdomain.com' => 'com_myfirstdomain.inc.php',
'webmail.myseconddomain.com' => 'com_myseconddomain.inc.php',
'webmail.mythirddomain.com' => 'com_mythirddomain.inc.php',
'webmail.myfourthdomain.com' => 'com_myfourthdomain.inc.php'
);

$config['plugins'] = array('password', 'markasjunk2', 'emoticons','archive','attachment_reminder','newmail_notifier','hide_blockquote','identity_select','managesieve','show_additional_headers','userinfo','vcard_attachments','mobile','gravatar','rc_smime','threecol');

$config['list_cols'] = array('flag', 'fromto', 'subject', 'attachment', 'status', 'date', 'size');

$config['default_charset'] = 'UTF-8';

$config['prefer_html'] = true;

$config['htmleditor'] = 1;

$config['default_list_mode'] = 'threads';

$config['reply_mode'] = 1;

$config['strip_existing_sig'] = true;

$config['show_sig'] = 1;

$config['sig_below'] = true;

$config['reply_same_folder'] = true;


P.S. Pardon the "mad face" emojis, I couldn't figure out how to turn emojis off and the ciphers string is being automatically converted.
 
Last edited:
/usr/share/psa-roundcube/config/defaults.inc.php say // WARNING: Do not edit this file! Copy configuration to config.inc.php.
so why dont you edit /usr/share/psa-roundcube/config/config.inc.php? you dont need to copy all, just add what you need to change from default.
 
Last edited:
/usr/share/psa-roundcube/config/defaults.inc.php say // WARNING: Do not edit this file! Copy configuration to config.inc.php.
so why dont you edit /usr/share/psa-roundcube/config/config.inc.php? you dont need to copy all, just add what you need to change from default.
If I remember correctly, a few years ago changes weren't being picked up in config.inc.php or they were overwritten. Perhaps it has been fixed in the meantime, I'll try it again and see what happens...
 
Well I must congratulate @IgorG and all those working on Plesk, I see it has come a long ways in the past couple years as regards SSL certificates and multiple domain management. I see that now Let's Encrypt certificates can not only be issued per domain, but also wildcarded and set not only for webmail but also for mail, and Plesk will actually set the Let's Encrypt certificate for each domain in the dovecot configurations. That's a big step forward and takes care of some of the custom modifications I have been doing, using self-signed certificates with a self-authorized certificate authority.
Up until now, in the gmail app on my smartphone, I had to use the option "SSL/TLS (accept all certificates)" or "STARTTLS (accept all certificates)". Now with the Let's Encrypt certificates enabled per domain in dovecot, I can use the "SSL/TLS" or "STARTTLS" and it works fine! Things are starting to look quite professional now. There are a few more tweaks that could be implemented to make everthing work a little more smoothly with clients like Outlook, but things are coming along nicely, so a big thank you to all the developers dedicating themselves to this project.
I see that I can also avoid telling Roundcube to look up my self-signed root CA certificate, seeing that Let's Encrypt certificates are well accepted. So I have modified my roundcube config now with this:
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'verify_peer_name' => true,
'allow_self_signed'=> false,
'ciphers' => 'TLSv1+HIGH:!aNull:mad:STRENGTH',
'crypto_method' => defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')
? (STREAM_CRYPTO_METHOD_TLS_CLIENT
| @STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
| @STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT)
: STREAM_CRYPTO_METHOD_SSLv23_CLIENT
)
);

and it is working well. I removed the "peer_name" since it will change according to the domain, and I see there are no errors when logging into roundcube mail. This is perhaps the new default config the Plesk sets, so perhaps I won't have to worry about fixing this anymore. However I still prefer certain settings such as forcing the domain name on user login, and not requiring to fill in the whole domain:
$config['username_domain'] = '%t';
$config['username_domain_forced'] = true;
$config['mail_domain'] = '%t';
If settings such as these are picked up in config.inc.php and won't be overwritten on an update, then everything is perfect.
 
Last edited:
If I remember correctly, a few years ago changes weren't being picked up in config.inc.php or they were overwritten. Perhaps it has been fixed in the meantime, I'll try it again and see what happens...
I tried it just now, and the changes in config.inc.php didn't make in into roundcube...

Any ideas ?
 
Has Plesk modiefied Roundcube in any way, so that config.inc.php isn't loaded?
Also, if I have multiple domains and I want to customise them in a different way, shouldn't there be domain-specific config.inc.php files in different folders ?
 
@Heinrich which version of Plesk are you using? I just updated Plesk yesterday from version 18.0.25 to 18.0.26 and I was able to confirm that FINALLY my custom configurations in config.inc.php were kept and are being used. I think maybe this issue has been fixed now, at least in this latest version 18.0.26 it seems to be working.
As regards domain specific configuration files, I have this in my config.inc.php to load specific configs for each domain:
$config['include_host_config'] = array(
'webmail.myfirstdomain.com' => 'com_myfirstdomain.inc.php',
'webmail.myseconddomain.eu' => 'eu_myseconddomain.inc.php',
'webmail.mythirddomain.io' => 'io_mythirddomain.inc.php',
'webmail.myfourthdomain.net' => 'net_myfourthdomain.inc.php'

);

And I have each one of those custom config files in the same directory as config.inc.php.
 
Last edited:
Can I find out why you needed to configure the file /usr/share/psa-roundcube/config/defaults.inc.php manually and why the default RoundCube webmail settings for domains and their mailboxes provided by Plesk does not suit you?
Hi Igor, the default Inbox sorting filter is not default by delivery date descending. This is upsetting and needs to be manually adjusted, everyone wants to have most recent e-mails in inbox on top.
 
You are using config.inc.php and custom.inc.php?
Is that a documented approach?
sorry it was a typo, it was supposed to be config.inc.php and not custom.inc.php .
However in the meantime my configs were overwritten again, and I have also noticed that configs are not always being picked up from config.inc.php, so my hopes are not as high as they were back in April. I guess it's really a good idea to keep a backup of the desired configuration, and then use a cron job to detect if there have been any changes to the defaults.inc.php config file, and in that case overwrite it with your desired configs.
 
Hi Igor,

Apologies for responding to this old post but it's the only one that came up in a search and it had a question from you that I think is valid.

The one thing that has been driving me crazy with Roundcube is that it defaults to adding replies to the bottom of the message. It's called "start new message below original" - this is just totally the opposite of how normal email works where people respond to the top of the email with older messages below.

Is this something Plesk can fix or is there a safe way to change this permanently in a custom config for Roundcube?
 
Back
Top