Roundcube Community Forum

 

Disable mailvelope in config

Started by VA1DER, August 12, 2024, 03:54:15 PM

Previous topic - Next topic

VA1DER

Is there a way to disable and/or hide mailvelope using a configuration option?

[edit] Or even a quick change I can make to a script to turn it off?

VA1DER

For anyone that comes after, it appears there is no setting to disable mailvelope.  The easiest way I found to get rid of it is to just disable the settings for it.  This should do that without interfering with enigma or other .

# diff -u5 program/actions/settings/index.php.orig program/actions/settings/index.php
--- program/actions/settings/index.php.orig     2023-11-04 13:52:34.000000000 -0300
+++ program/actions/settings/index.php  2024-08-12 18:35:37.482468945 -0300
@@ -1459,15 +1459,15 @@

             // Server settings
             case 'encryption':
                 $blocks = [
                     'main'       => ['name' => rcube::Q($rcmail->gettext('mainoptions'))],
-                    'mailvelope' => ['name' => rcube::Q($rcmail->gettext('mailvelopeoptions'))],
+                    // 'mailvelope' => ['name' => rcube::Q($rcmail->gettext('mailvelopeoptions'))],
                     'advanced'   => ['name' => rcube::Q($rcmail->gettext('advancedoptions'))],
                 ];

-                if (!isset($no_override['mailvelope_main_keyring'])) {
+                /*if (!isset($no_override['mailvelope_main_keyring'])) {
                     if (!$current) {
                         continue 2;
                     }

                     $field_id = 'rcmfd_mailvelope_main_keyring';
@@ -1486,11 +1486,11 @@

                     $blocks['mailvelope']['options']['mailvelope_main_keyring'] = [
                         'title'   => html::label($field_id, rcube::Q($rcmail->gettext('mailvelopemainkeyring'))),
                         'content' => $input->show(!empty($config['mailvelope_main_keyring']) ? 1 : 0),
                     ];
-                }
+                }*/

                 break;
             }

             $found = false;

SKaero

I haven't tried it but I think you would be able to hide the settings with the dont_override config settings.
// don't allow these settings to be overridden by the user
$config['dont_override'] = [];

VA1DER

Thanks kindly.

Setting:
$config['dont_override'] = ['mailvelope_main_keyring'];...seems to do the trick.  To really make sure it's disabled, I set both configuration parameters I could see to unusable values, then turned on the don't override for them:
$config['mailvelope_main_keyring'] = 'disable';
$config['mailvelope_keysize'] = 'disable';
$config['dont_override'] = ['mailvelope_main_keyring', 'mailvelope_keysize'];