summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/sendmail.inc
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-20 21:28:30 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-05-20 21:28:30 +0000
commit83b297e2b198bd9034fb82d942353be51d003dea (patch)
tree0217411e199512df81188a1a75d64f7b0a8fc96c /roundcubemail/program/steps/mail/sendmail.inc
parent36077f1171371c85657d646c7fc34485ff0a5ce0 (diff)
Display and send messages with format=flowed (#1484370), fixes word wrapping issues (#1486543)
git-svn-id: https://svn.roundcube.net/trunk@3644 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/sendmail.inc')
-rw-r--r--roundcubemail/program/steps/mail/sendmail.inc15
1 files changed, 10 insertions, 5 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc
index e7f5b9557..8e43b37a0 100644
--- a/roundcubemail/program/steps/mail/sendmail.inc
+++ b/roundcubemail/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'))