diff --unified --recursive roundcubemail-0.7.1/config/main.inc.php.dist roundcubemail-0.7.1-ja-20120126taka2/config/main.inc.php.dist --- roundcubemail-0.7.1/config/main.inc.php.dist 2011-11-30 22:11:34.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/config/main.inc.php.dist 2012-01-16 14:45:28.000000000 +0900 @@ -730,6 +730,9 @@ // When replying place cursor above original message (top posting) $rcmail_config['top_posting'] = false; +// Default charset for sending message +$rcmail_config['send_charset'] = 'ISO-8859-1'; + // When replying strip original signature from message $rcmail_config['strip_existing_sig'] = true; @@ -746,6 +749,9 @@ // Use MIME encoding (quoted-printable) for 8bit characters in message body $rcmail_config['force_7bit'] = false; +// Use MIME B encoding (base64) for header +$rcmail_config['head_encoding_base64'] = false; + // Defaults of the search field configuration. // The array can contain a per-folder list of header fields which should be considered when searching // The entry with key '*' stands for all folders which do not have a specific list set. diff --unified --recursive roundcubemail-0.7.1/program/localization/en_US/labels.inc roundcubemail-0.7.1-ja-20120126taka2/program/localization/en_US/labels.inc --- roundcubemail-0.7.1/program/localization/en_US/labels.inc 2012-01-04 21:37:51.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/program/localization/en_US/labels.inc 2012-01-16 14:45:28.000000000 +0900 @@ -402,6 +402,7 @@ $labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)'; $labels['2047folding'] = 'Full RFC 2047 (other)'; $labels['force7bit'] = 'Use MIME encoding for 8-bit characters'; +$labels['encodingbase64'] = 'Use MIME B encoding for header'; $labels['advancedoptions'] = 'Advanced options'; $labels['focusonnewmessage'] = 'Focus browser window on new message'; $labels['checkallfolders'] = 'Check all folders for new messages'; diff --unified --recursive roundcubemail-0.7.1/program/localization/ja_JP/labels.inc roundcubemail-0.7.1-ja-20120126taka2/program/localization/ja_JP/labels.inc --- roundcubemail-0.7.1/program/localization/ja_JP/labels.inc 2011-12-07 23:47:32.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/program/localization/ja_JP/labels.inc 2012-01-16 14:45:28.000000000 +0900 @@ -405,6 +405,7 @@ $labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)'; $labels['2047folding'] = 'RFC 2047 準拠 (他のメーラー)'; $labels['force7bit'] = 'マルチバイト文字列を MIME エンコードする'; +$labels['encodingbase64'] = 'ヘッダをMIME Base64エンコードする'; $labels['advancedoptions'] = '高度な設定'; $labels['focusonnewmessage'] = '新着メールが届いたらブラウザーをアクティブにする'; $labels['checkallfolders'] = '全フォルダーで新着メールを表示する'; diff --unified --recursive roundcubemail-0.7.1/program/steps/mail/compose.inc roundcubemail-0.7.1-ja-20120126taka2/program/steps/mail/compose.inc --- roundcubemail-0.7.1/program/steps/mail/compose.inc 2012-01-02 04:10:53.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/program/steps/mail/compose.inc 2012-01-16 14:45:28.000000000 +0900 @@ -1422,6 +1422,16 @@ } +function rcmail_charset_selector($attrib) +{ + global $RCMAIL; + return $RCMAIL->output->charset_selector(array( + 'name' => '_charset', + 'selected' => $RCMAIL->config->get('send_charset') + )); +} + + function rcmail_check_sent_folder($folder, $create=false) { global $IMAP; @@ -1482,6 +1492,7 @@ 'receiptcheckbox' => 'rcmail_receipt_checkbox', 'dsncheckbox' => 'rcmail_dsn_checkbox', 'storetarget' => 'rcmail_store_target_selection', + 'charsetselector' => 'rcmail_charset_selector', )); $OUTPUT->send('compose'); diff --unified --recursive roundcubemail-0.7.1/program/steps/mail/sendmail.inc roundcubemail-0.7.1-ja-20120126taka2/program/steps/mail/sendmail.inc --- roundcubemail-0.7.1/program/steps/mail/sendmail.inc 2011-12-02 18:58:03.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/program/steps/mail/sendmail.inc 2012-01-16 14:45:28.000000000 +0900 @@ -209,7 +209,9 @@ // set default charset $input_charset = $OUTPUT->get_charset(); -$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset; +$send_charset = $RCMAIL->config->get('send_charset'); +$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : + $send_charset != '' ? $send_charset : $input_charset; $EMAIL_FORMAT_ERROR = NULL; $RECIPIENT_COUNT = 0; @@ -570,19 +572,22 @@ else $transfer_encoding = '7bit'; +$head_encoding = $RCMAIL->config->get('head_encoding_base64') ? 'base64' : 'quoted-printable'; + // encoding settings for mail composing $MAIL_MIME->setParam('text_encoding', $transfer_encoding); $MAIL_MIME->setParam('html_encoding', 'quoted-printable'); -$MAIL_MIME->setParam('head_encoding', 'quoted-printable'); +$MAIL_MIME->setParam('head_encoding', $head_encoding); $MAIL_MIME->setParam('head_charset', $message_charset); $MAIL_MIME->setParam('html_charset', $message_charset); $MAIL_MIME->setParam('text_charset', $message_charset . ($flowed ? ";\r\n format=flowed" : '')); // encoding subject header with mb_encode provides better results with asian characters if (function_exists('mb_encode_mimeheader')) { + $head_encoding_mode = $RCMAIL->config->get('head_encoding_base64') ? 'B' : 'Q'; mb_internal_encoding($message_charset); $headers['Subject'] = mb_encode_mimeheader($headers['Subject'], - $message_charset, 'Q', "\r\n", 8); + $message_charset, $head_encoding_mode, "\r\n", 8); mb_internal_encoding(RCMAIL_CHARSET); } diff --unified --recursive roundcubemail-0.7.1/program/steps/settings/func.inc roundcubemail-0.7.1-ja-20120126taka2/program/steps/settings/func.inc --- roundcubemail-0.7.1/program/steps/settings/func.inc 2011-12-28 18:37:17.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/program/steps/settings/func.inc 2012-01-16 14:45:28.000000000 +0900 @@ -532,6 +532,16 @@ ); } + if (!isset($no_override['head_encoding_base64'])) { + $field_id = 'rcmfd_head_encoding_base64'; + $input_7bit = new html_checkbox(array('name' => '_head_encoding_base64', 'id' => $field_id, 'value' => 1)); + + $blocks['main']['options']['head_encoding_base64'] = array( + 'title' => html::label($field_id, Q(rcube_label('encodingbase64'))), + 'content' => $input_7bit->show($config['head_encoding_base64']?1:0), + ); + } + if (!isset($no_override['mdn_default'])) { $field_id = 'rcmfd_mdn_default'; $input_mdn = new html_checkbox(array('name' => '_mdn_default', 'id' => $field_id, 'value' => 1)); @@ -574,6 +584,17 @@ ); } + if (!isset($no_override['send_charset'])) { + $field_id = 'rcmfd_send_charset'; + + $blocks['main']['options']['send_charset'] = array( + 'title' => html::label($field_id, Q(rcube_label('defaultcharset'))), + 'content' => $RCMAIL->output->charset_selector(array( + 'name' => '_send_charset', 'selected' => $config['send_charset'] + )) + ); + } + if (!isset($no_override['spellcheck_before_send']) && $config['enable_spellcheck']) { $field_id = 'rcmfd_spellcheck_before_send'; $input_spellcheck = new html_checkbox(array('name' => '_spellcheck_before_send', 'id' => $field_id, 'value' => 1)); diff --unified --recursive roundcubemail-0.7.1/program/steps/settings/save_prefs.inc roundcubemail-0.7.1-ja-20120126taka2/program/steps/settings/save_prefs.inc --- roundcubemail-0.7.1/program/steps/settings/save_prefs.inc 2011-12-05 16:24:36.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/program/steps/settings/save_prefs.inc 2012-01-16 14:45:28.000000000 +0900 @@ -75,6 +75,7 @@ 'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0, 'mime_param_folding' => isset($_POST['_mime_param_folding']) ? intval($_POST['_mime_param_folding']) : 0, 'force_7bit' => isset($_POST['_force_7bit']) ? TRUE : FALSE, + 'head_encoding_base64' => isset($_POST['_head_encoding_base64']) ? TRUE : FALSE, 'mdn_default' => isset($_POST['_mdn_default']) ? TRUE : FALSE, 'dsn_default' => isset($_POST['_dsn_default']) ? TRUE : FALSE, 'reply_same_folder' => isset($_POST['_reply_same_folder']) ? TRUE : FALSE, @@ -86,6 +87,7 @@ 'top_posting' => !empty($_POST['_top_posting']), 'strip_existing_sig' => isset($_POST['_strip_existing_sig']), 'sig_above' => !empty($_POST['_sig_above']) && !empty($_POST['_top_posting']), + 'send_charset' => get_input_value('_send_charset', RCUBE_INPUT_POST), ); break; diff --unified --recursive roundcubemail-0.7.1/skins/default/templates/compose.html roundcubemail-0.7.1-ja-20120126taka2/skins/default/templates/compose.html --- roundcubemail-0.7.1/skins/default/templates/compose.html 2012-01-02 04:10:53.000000000 +0900 +++ roundcubemail-0.7.1-ja-20120126taka2/skins/default/templates/compose.html 2012-01-16 14:45:28.000000000 +0900 @@ -139,6 +139,9 @@