diff --git a/CHANGELOG b/CHANGELOG index a8a52ca48..cee177f8e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Make optional adding of standard signature separator - sig_separator (#1487768) - Optimize folder_size() on Cyrus IMAP by using special folder annotation (#1490514) - Make optional hidding of folders with name starting with a dot - imap_skip_hidden_folders (#1490468) - Add option to enable HTML editor always, except when replying to plain text messages (#1489365) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 3bb8cf9bb..a3b7b5380 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -1116,6 +1116,9 @@ $config['show_sig'] = 1; // the signature below the quoted text (sig_below = true). $config['sig_below'] = false; +// Enables adding of standard separator to the signature +$config['sig_separator'] = true; + // Use MIME encoding (quoted-printable) for 8bit characters in message body $config['force_7bit'] = false; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index e3f6fc8a8..90d2c30c2 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -511,6 +511,7 @@ $labels['newmessageonly'] = 'new message only'; $labels['replyandforwardonly'] = 'replies and forwards only'; $labels['insertsignature'] = 'Insert signature'; $labels['sigbelow'] = 'Place signature below the quoted message'; +$labels['sigseparator'] = 'Force standard separator in signatures'; $labels['previewpanemarkread'] = 'Mark previewed messages as read'; $labels['afternseconds'] = 'after $n seconds'; $labels['reqmdn'] = 'Always request a return receipt'; diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 807d0efd4..488b82e5f 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -484,7 +484,9 @@ function rcmail_compose_header_from($attrib) $top_posting = intval($RCMAIL->config->get('reply_mode')) > 0 && !$RCMAIL->config->get('sig_below') && ($COMPOSE['mode'] == RCUBE_COMPOSE_REPLY || $COMPOSE['mode'] == RCUBE_COMPOSE_FORWARD); - $separator = $top_posting ? '---' : '-- '; + + $separator = $top_posting ? '---' : '-- '; + $add_separator = (bool) $RCMAIL->config->get('sig_separator'); $field_attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.".change_identity(this)"; $select_from = new html_select($field_attrib); @@ -500,15 +502,15 @@ function rcmail_compose_header_from($attrib) if ($sql_arr['html_signature']) { $text = $RCMAIL->html2text($html, array('links' => false)); - $text = trim($text); + $text = trim($text, "\r\n"); } else { $t2h = new rcube_text2html($text, false); $html = $t2h->get_html(); } - if (!preg_match('/^--[ -]\r?\n/m', $text)) { - $text = $separator . "\n" . $text; + if ($add_separator && !preg_match('/^--[ -]\r?\n/m', $text)) { + $text = $separator . "\n" . ltrim($text, "\r\n"); $html = $separator . "
" . $html; } diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 22c02ee21..061ba1263 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -874,6 +874,20 @@ function rcmail_user_prefs($current = null) ); } + if (!isset($no_override['sig_separator'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_sig_separator'; + $input = new html_checkbox(array('name' => '_sig_separator', 'id' => $field_id, 'value' => 1)); + + $blocks['sig']['options']['sig_separator'] = array( + 'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('sigseparator'))), + 'content' => $input->show($RCMAIL->config->get('sig_separator') ? 1 : 0), + ); + } + if (!isset($no_override['forward_attachment'])) { if (!$current) { continue 2; diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 91104cb26..355954c8e 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -87,6 +87,7 @@ case 'compose': 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0, 'sig_below' => isset($_POST['_sig_below']) ? true : false, 'strip_existing_sig' => isset($_POST['_strip_existing_sig']), + 'sig_separator' => isset($_POST['_sig_separator']) ? true : false, 'default_font' => rcube_utils::get_input_value('_default_font', rcube_utils::INPUT_POST), 'default_font_size' => rcube_utils::get_input_value('_default_font_size', rcube_utils::INPUT_POST), 'reply_all_mode' => intval($_POST['_reply_all_mode']),