summaryrefslogtreecommitdiff
path: root/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-05-20 21:28:30 +0000
committerthomascube <thomas@roundcube.net>2010-05-20 21:28:30 +0000
commit6b6f2e83de0e5b48ba48583206bd456508554540 (patch)
tree4d687f9dbd86fb24a1c86703340c19aa7927fc28 /program/steps/mail/sendmail.inc
parente93c72d9a378903502fa51452d6db3fffc3a9b28 (diff)
Display and send messages with format=flowed (#1484370), fixes word wrapping issues (#1486543)
Diffstat (limited to 'program/steps/mail/sendmail.inc')
-rw-r--r--program/steps/mail/sendmail.inc15
1 files changed, 10 insertions, 5 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index e7f5b9557..8e43b37a0 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -5,7 +5,7 @@
| program/steps/mail/sendmail.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -440,11 +440,16 @@ if ($isHtml) {
// look for "emoticon" images from TinyMCE and copy into message as attachments
$message_body = rcmail_attach_emoticons($MAIL_MIME);
}
-else
- {
- $message_body = rc_wordwrap($message_body, $LINE_LENGTH, "\r\n");
+else {
if ($footer)
$message_body .= "\r\n" . $footer;
+
+ // compose format=flowed content if enabled and not a reply message
+ if (empty($_SESSION['compose']['reply_msgid']) && ($flowed = $RCMAIL->config->get('send_format_flowed', true)))
+ $message_body = rcube_message::format_flowed($message_body, $LINE_LENGTH);
+ else
+ $message_body = rc_wordwrap($message_body, min(79, $LINE_LENGTH + 8), "\r\n"); // +8: be generous with quoted lines
+
$message_body = wordwrap($message_body, 998, "\r\n", true);
if (!strlen($message_body)) {
// empty message body breaks attachment handling in drafts
@@ -503,7 +508,7 @@ $MAIL_MIME->setParam('html_encoding', 'quoted-printable');
$MAIL_MIME->setParam('head_encoding', 'quoted-printable');
$MAIL_MIME->setParam('head_charset', $message_charset);
$MAIL_MIME->setParam('html_charset', $message_charset);
-$MAIL_MIME->setParam('text_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'))