Roundcube Community Forum

SVN Releases => Issues & Bugs => Topic started by: drewpydraws on February 11, 2009, 12:34:49 AM

Title: new lines in footer are stripped
Post by: drewpydraws on February 11, 2009, 12:34:49 AM
I spent some time on this problem so thought I would post the solution I came up with for anyone else.

If your footer.txt file has newlines in it they will be stripped in the plaintext portion of a MIME email, but they are not stripped in the HTML version.

The problem is that html2text is stripping my new lines. Rather than spending time trying to figure that out I came up with this work around.

In /program/steps/mail/sendmail.inc I made the following changes.

Remove these line (282):
$message_body .= "\r\n" . rcube_charset_convert($footer, 'UTF-8', $message_charset);

Change line 292:
From:
$MAIL_MIME->setHTMLBody($message_body);
To:
$MAIL_MIME->setHTMLBody($message_body."\r\n
". rcube_charset_convert($footer, 'UTF-8', $message_charset)."
");

Change line 296:
From:
$plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true);
To:
$plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true)."\r\n". rcube_charset_convert($footer, 'UTF-8', $message_charset);

That will now prevent the newlines from being stripped and let my footer file work like I wanted it to. Also with a slight modification it could be used to appending a different footer to the HTML message vs the TEXT message. But I didn't take it quite that far yet.


created bug ticket
http://trac.roundcube.net/ticket/1485751