diff --git a/root/etc/e-smith/db/configuration/migrate/80roundcube b/root/etc/e-smith/db/configuration/migrate/80roundcube index 326f61e..dce030d 100644 --- a/root/etc/e-smith/db/configuration/migrate/80roundcube +++ b/root/etc/e-smith/db/configuration/migrate/80roundcube @@ -8,13 +8,23 @@ $DB->set_prop('roundcube','access', "private"); $DB->set_prop('roundcube','access', "public") if ($PublicAccess =~ /global/); $DB->set_prop('roundcube','status', "disabled") if ($PublicAccess == "none"); - } + } my $pw = $rec->prop('DbPassword'); - return "" if $pw; - $rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() ))); + $rec->set_prop('DbPassword', sprintf("%15.0f", int( (1000000000000000) * rand() ))) unless $pw; + + my $pwd = $rec->prop('des_key'); + unless ($pwd) { + open( RANDOM, "/dev/urandom" ); + my $buf; + read( RANDOM, $buf, 17); + $pwd = encode_base64($buf); + chomp $pwd; + close RANDOM; + $rec->set_prop('des_key', $pwd); + } } diff --git a/root/etc/e-smith/templates/etc/roundcubemail/config.inc.php/60SYSTEM b/root/etc/e-smith/templates/etc/roundcubemail/config.inc.php/60SYSTEM index 3141b78..1490a04 100644 --- a/root/etc/e-smith/templates/etc/roundcubemail/config.inc.php/60SYSTEM +++ b/root/etc/e-smith/templates/etc/roundcubemail/config.inc.php/60SYSTEM @@ -113,14 +113,7 @@ $config['x_frame_options'] = 'sameorigin'; // in the session record (and the client cookie if remember password is enabled). // please provide a string of exactly 24 chars. { -use MIME::Base64 qw(encode_base64); -open( RANDOM, "/dev/urandom" ); -my $buf; -read( RANDOM, $buf, 17); -my $pwd = encode_base64($buf); -chomp $pwd; -close RANDOM; -$OUT .= "\$config['des_key'] = \'$pwd\' ;\n"; +$OUT .= "\$config['des_key'] = \'".$roundcube{'des_key'}."\' ;\n"; } // Automatically add this domain to user names for login diff --git a/smeserver-roundcube.spec b/smeserver-roundcube.spec index 4f9c0a7..d9b05b4 100644 --- a/smeserver-roundcube.spec +++ b/smeserver-roundcube.spec @@ -86,7 +86,8 @@ fi %changelog * Mon Feb 17 2025 Jean-Philippe Pialasse 1.6-7.sme -- fix roundcube not accessibel after install [SME: 12928] +- fix roundcube not accessible after install [SME: 12928] +- avoid need to relog in case of reloading of configuration [SME: 12929] * Wed Feb 12 2025 Jean-Philippe Pialasse 1.6-6.sme - fix typo in roundcubemail.action [SME: 12917]