On Debian 11, Roundcube 1.4.12 is malfunctional "aliases" + "out of office".
Here is diff
diff -aur /usr/src/roundcube-toolbox-1.4.10.1/lib/Roundcube/rcube_toolbox_storage_sql_helper.php /usr/share/roundcube/plugins/toolbox/lib/Roundcube/rcube_toolbox_storage_sql_helper.php
--- /usr/src/roundcube-toolbox-1.4.10.1/lib/Roundcube/rcube_toolbox_storage_sql_helper.php 2021-01-22 14:08:58.000000000 +0100
+++ /usr/share/roundcube/plugins/toolbox/lib/Roundcube/rcube_toolbox_storage_sql_helper.php 2021-12-14 17:34:02.925234763 +0100
@@ -157,7 +157,8 @@
// convert formatted string into timestamp/datetime
public function to_timestamp($field, $format)
{
- $date = DateTime::createFromFormat($format['php'], $date);
+ //$date = DateTime::createFromFormat($format['php'], $date);
+ $date = DateTime::createFromFormat($format['php'], $field);
$dsn = $this->db::parse_dsn($this->dsn);
$format = $format[$dsn['phptype']];
switch ($dsn['phptype']) {
diff -aur /usr/src/roundcube-toolbox-1.4.10.1/lib/Roundcube/rcube_toolbox_storage_sql.php /usr/share/roundcube/plugins/toolbox/lib/Roundcube/rcube_toolbox_storage_sql.php
--- /usr/src/roundcube-toolbox-1.4.10.1/lib/Roundcube/rcube_toolbox_storage_sql.php 2021-01-22 14:08:58.000000000 +0100
+++ /usr/share/roundcube/plugins/toolbox/lib/Roundcube/rcube_toolbox_storage_sql.php 2021-12-17 01:11:46.186899190 +0100
@@ -607,13 +607,15 @@
rcube::write_log($this->logfile, "SQL in [storage].[sql].[function save_tool_data]: execute query [INSERT INTO `{$this->postfix_sql_alias_table_name}` (`{$this->postfix_sql_address_field_in_alias}`, `{$this->postfix_sql_goto_field_in_alias}`, `{$this->postfix_sql_domain_field_in_alias}`, `{$this->postfix_sql_created_field_in_alias}`, `{$this->postfix_sql_modified_field_in_alias}`, `{$this->postfix_sql_active_field_in_alias}`) VALUES ('{$address}', '{$user}', '{$parts[1]}', '{$this->db->now()}', '{$this->db->now()}', '{$settings['main']['active']}');]");
}
$this->db->query(
- "INSERT INTO `{$this->postfix_sql_alias_table_name}` (`{$this->postfix_sql_address_field_in_alias}`, `{$this->postfix_sql_goto_field_in_alias}`, `{$this->postfix_sql_domain_field_in_alias}`, `{$this->postfix_sql_created_field_in_alias}`, `{$this->postfix_sql_modified_field_in_alias}`, `{$this->postfix_sql_active_field_in_alias}`) VALUES (?, ?, ?, ?, ?, ?);",
+ //"INSERT INTO `{$this->postfix_sql_alias_table_name}` (`{$this->postfix_sql_address_field_in_alias}`, `{$this->postfix_sql_goto_field_in_alias}`, `{$this->postfix_sql_domain_field_in_alias}`, `{$this->postfix_sql_created_field_in_alias}`, `{$this->postfix_sql_modified_field_in_alias}`, `{$this->postfix_sql_active_field_in_alias}`) VALUES (?, ?, ?, ?, ?, ?);",
+ "INSERT INTO `{$this->postfix_sql_alias_table_name}` (`{$this->postfix_sql_address_field_in_alias}`, `{$this->postfix_sql_goto_field_in_alias}`, `{$this->postfix_sql_domain_field_in_alias}`, `{$this->postfix_sql_created_field_in_alias}`, `{$this->postfix_sql_modified_field_in_alias}`, `{$this->postfix_sql_active_field_in_alias}`) VALUES (?, ?, ?, {$this->db->now()}, {$this->db->now()}, {$settings['main']['active']});",
$address,
$user,
$parts[1],
- $this->db->now(),
- $this->db->now(),
- $settings['main']['active']);
+ //$this->db->now(),
+ //$this->db->now(),
+ //$settings['main']['active']
+ );
if ($this->loglevel > 0) {
if ($err_str = $this->db->is_error()) {
rcube::write_log($this->logfile, "ERROR in [storage].[sql].[function save_tool_data]: cannot insert into alias: " . $err_str);
@@ -776,8 +778,9 @@
else {
$settings['main']['created'] = $this->db->now();
$queries[] = [
- 'sql' => "INSERT INTO {$this->postfix_sql_vacation_table_name} (" . implode(', ', array_keys($settings['main'])) . ") VALUES (" . implode(',',array_values($settings['main'])) . ");",
- 'data' => [],
+ //'sql' => "INSERT INTO {$this->postfix_sql_vacation_table_name} (" . implode(', ', array_keys($settings['main'])) . ") VALUES (" . implode(',',array_values($settings['main'])) . ");",
+ 'sql' => "INSERT INTO {$this->postfix_sql_vacation_table_name} (`{$this->postfix_sql_email_field_in_vacation}`, `{$this->postfix_sql_domain_field_in_vacation}`, " . implode(', ', array_keys($settings['main'])) . ") VALUES (?,?," . implode(',',array_values($settings['main'])) . ");",
+ 'data' => [$user, $parts[1]],
'type' => 'insert'
];
}
@@ -790,6 +793,18 @@
];
//remove autoreply address from alias list, but keep custom aliases
+ $concat = $this->db->concat($this->db->quote($parts[0]),$this->db->quote('#'),$this->db->quote($parts[1]),$this->db->quote('@'),$this->db->quote($this->postfixadmin_vacation_domain),$this->db->quote(','));
+ $queries[] = [
+ 'sql' => "UPDATE {$this->postfix_sql_alias_table_name} SET `{$this->postfix_sql_goto_field_in_alias}` = replace({$this->postfix_sql_goto_field_in_alias}, {$concat}, ''), `{$this->postfix_sql_modified_field_in_alias}` = {$this->db->now()} WHERE `{$this->postfix_sql_address_field_in_alias}` = ? AND `{$this->postfix_sql_domain_field_in_alias}` = ?;",
+ 'data' => [$user, $parts[1]],
+ 'type' => 'update'
+ ];
+ $concat = $this->db->concat($this->db->quote(','),$this->db->quote($parts[0]),$this->db->quote('#'),$this->db->quote($parts[1]),$this->db->quote('@'),$this->db->quote($this->postfixadmin_vacation_domain));
+ $queries[] = [
+ 'sql' => "UPDATE {$this->postfix_sql_alias_table_name} SET `{$this->postfix_sql_goto_field_in_alias}` = replace({$this->postfix_sql_goto_field_in_alias}, {$concat}, ''), `{$this->postfix_sql_modified_field_in_alias}` = {$this->db->now()} WHERE `{$this->postfix_sql_address_field_in_alias}` = ? AND `{$this->postfix_sql_domain_field_in_alias}` = ?;",
+ 'data' => [$user, $parts[1]],
+ 'type' => 'update'
+ ];
$concat = $this->db->concat($this->db->quote($parts[0]),$this->db->quote('#'),$this->db->quote($parts[1]),$this->db->quote('@'),$this->db->quote($this->postfixadmin_vacation_domain));
$queries[] = [
'sql' => "UPDATE {$this->postfix_sql_alias_table_name} SET `{$this->postfix_sql_goto_field_in_alias}` = replace({$this->postfix_sql_goto_field_in_alias}, {$concat}, ''), `{$this->postfix_sql_modified_field_in_alias}` = {$this->db->now()} WHERE `{$this->postfix_sql_address_field_in_alias}` = ? AND `{$this->postfix_sql_domain_field_in_alias}` = ?;",
@@ -798,12 +813,13 @@
];
//add autoreply address as alias
- $concat = $this->db->concat($this->postfix_sql_goto_field_in_alias,$this->db->quote($parts[0]),$this->db->quote('#'),$this->db->quote($parts[1]),$this->db->quote('@'),$this->db->quote($this->postfixadmin_vacation_domain));
- $queries[] = [
+ //$concat = $this->db->concat($this->postfix_sql_goto_field_in_alias,$this->db->quote($parts[0]),$this->db->quote('#'),$this->db->quote($parts[1]),$this->db->quote('@'),$this->db->quote($this->postfixadmin_vacation_domain));
+ $concat = $this->db->concat($this->postfix_sql_goto_field_in_alias,$this->db->quote(','),$this->db->quote($parts[0]),$this->db->quote('#'),$this->db->quote($parts[1]),$this->db->quote('@'),$this->db->quote($this->postfixadmin_vacation_domain));
+ if ( $settings['main']['active'] == 'true' ) { $queries[] = [
'sql' => "UPDATE {$this->postfix_sql_alias_table_name} SET `{$this->postfix_sql_goto_field_in_alias}` = {$concat}, `{$this->postfix_sql_modified_field_in_alias}` = {$this->db->now()} WHERE `{$this->postfix_sql_address_field_in_alias}` = ? AND `{$this->postfix_sql_domain_field_in_alias}` = ? AND `{$this->postfix_sql_active_field_in_alias}` = true;",
'data' => [$user, $parts[1]],
'type' => 'update'
- ];
+ ]; }
foreach ($queries as $query) {
@@ -860,11 +876,12 @@
rcube::write_log($this->logfile, "SQL in [storage].[sql].[function save_tool_data]: execute query [INSERT INTO `toolbox_customise_domains` (`domain_name`, `purge_trash`, `purge_junk`, `modified`, `modified_by`) VALUES ('{$parts[1]}', '{$settings['domain']['purge_trash']}', '{$settings['domain']['purge_junk']}', '{$this->db->now()}', '{$user}');]");
}
$this->db->query(
- "INSERT INTO `toolbox_customise_domains` (`domain_name`, `purge_trash`, `purge_junk`, `modified`, `modified_by`) VALUES (?, ?, ?, ?, ?);",
+ //"INSERT INTO `toolbox_customise_domains` (`domain_name`, `purge_trash`, `purge_junk`, `modified`, `modified_by`) VALUES (?, ?, ?, ?, ?);",
+ "INSERT INTO `toolbox_customise_domains` (`domain_name`, `purge_trash`, `purge_junk`, `modified`, `modified_by`) VALUES (?, ?, ?, {$this->db->now()}, ?);",
$parts[1],
$settings['domain']['purge_trash'],
$settings['domain']['purge_junk'],
- $this->db->now(),
+ //$this->db->now(),
$user);
if ($this->loglevel > 0) {
if ($err_str = $this->db->is_error()) {
@@ -957,7 +974,8 @@
rcube::write_log($this->logfile, "SQL in [storage].[sql].[function save_tool_data]: execute query [INSERT INTO `toolbox_customise_skins` (`toolbox_customise_domain_id`, `skin`, `blankpage_type`, `blankpage_image`, `blankpage_url`, `blankpage_custom`, `additional_css`, `modified`, `modified_by`) VALUES ('{$domain_id}', '{$skin}', '{$values['blankpage_type']}', '{$values['blankpage_image']}', '{$values['blankpage_url']}', '{$values['blankpage_custom']}', '{$values['additional_css']}', '{$this->db->now()}', '{$user}');]");
}
$this->db->query(
- "INSERT INTO `toolbox_customise_skins` (`toolbox_customise_domain_id`, `skin`, `customise_blankpage`, `blankpage_type`, `blankpage_image`, `blankpage_url`, `blankpage_custom`, `customise_css`, `additional_css`, `customise_logo`, `customised_logo`, `modified`, `modified_by`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
+ //"INSERT INTO `toolbox_customise_skins` (`toolbox_customise_domain_id`, `skin`, `customise_blankpage`, `blankpage_type`, `blankpage_image`, `blankpage_url`, `blankpage_custom`, `customise_css`, `additional_css`, `customise_logo`, `customised_logo`, `modified`, `modified_by`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
+ "INSERT INTO `toolbox_customise_skins` (`toolbox_customise_domain_id`, `skin`, `customise_blankpage`, `blankpage_type`, `blankpage_image`, `blankpage_url`, `blankpage_custom`, `customise_css`, `additional_css`, `customise_logo`, `customised_logo`, `modified`, `modified_by`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, {$this->db->now()}, ?);",
$domain_id,
$skin,
$values['customise_blankpage'],
@@ -969,7 +987,7 @@
$values['additional_css'],
$values['customise_logo'],
$values['customised_logo'],
- $this->db->now(),
+ //$this->db->now(),
$user);
if ($this->loglevel > 0) {
if ($err_str = $this->db->is_error()) {
Pouze v /usr/share/roundcube/plugins/toolbox/localization: cs_CZ.inc
diff -aur /usr/src/roundcube-toolbox-1.4.10.1/toolbox.php /usr/share/roundcube/plugins/toolbox/toolbox.php
--- /usr/src/roundcube-toolbox-1.4.10.1/toolbox.php 2021-01-22 14:08:58.000000000 +0100
+++ /usr/share/roundcube/plugins/toolbox/toolbox.php 2021-12-16 12:11:09.818875392 +0100
@@ -1193,8 +1193,8 @@
rcube::write_log($this->logfile, "STEP in [function save]: prepare vacation settings");
}
$new_settings['main']['active'] = rcube_utils::get_input_value('_vacationactive', rcube_utils::INPUT_POST) ?: false;
- $new_settings['main']['activefrom'] = rcube_utils::get_input_value('_vacationactivefrom', rcube_utils::INPUT_POST) ?: date("Y-m-d H:i:s");
- $new_settings['main']['activeuntil'] = rcube_utils::get_input_value('_vacationactiveuntil', rcube_utils::INPUT_POST) ?: date('"Y-m-d H:i:s"', strtotime("+1 week"));
+ $new_settings['main']['activefrom'] = rcube_utils::get_input_value('_vacationactivefrom', rcube_utils::INPUT_POST) ?: date($this->rcube->config->get('toolbox_vacation_dateformat')['php']);
+ $new_settings['main']['activeuntil'] = rcube_utils::get_input_value('_vacationactiveuntil', rcube_utils::INPUT_POST) ?: date($this->rcube->config->get('toolbox_vacation_dateformat')['php'], strtotime("+1 week"));
$new_settings['main']['interval_time'] = rcube_utils::get_input_value('_vacationintervaltime', rcube_utils::INPUT_POST) ?: $this->rcube->config->get('toolbox_vacation_interval_time')['replyonce'];
$new_settings['main']['subject'] = rcube_utils::get_input_value('_vacationsubject', rcube_utils::INPUT_POST) ?: $this->rcube->config->get('toolbox_vacation_subject');
$new_settings['main']['body'] = rcube_utils::get_input_value('_vacationbody', rcube_utils::INPUT_POST) ?: $this->rcube->config->get('toolbox_vacation_body');