Opened 6 years ago
Closed 6 years ago
#1484148 closed Bugs (fixed)
Roundcube generates overlength lines in plaintext messages
| Reported by: | bumpus | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1-rc1 |
| Component: | Client Scripts | Version: | git-master |
| Severity: | normal | Keywords: | |
| Cc: |
Description
According to RFC2822Messages sent in text/plain format SHOULD not contain lines that are more than 78 character and MUST not contain lines that are more than 998 characters. Roundcube produces messages that violate both of these provisions (when given a paragraph of text that is over 998 characters anyway).
The result of this is that many clients that receive such messages present them with a horizontal scroll bar or otherwise make such messages difficult to read.
Outgoing mail SHOULD be word wrapped so that plaintext messages are properly readable in a standard 80 column window.
Attachments (1)
Change History (5)
Changed 6 years ago by bumpus
comment:1 Changed 6 years ago by dmandell
This bug still exists in the trunk, I'm not smart enough to fix it but because it breaks RFC I'm hoping someone else will.
comment:2 Changed 6 years ago by seansan
- Milestone set to 0.1-rc1
[proposed fix]
dmandell - check the standard function for it in PHP
http://nl2.php.net/wordwrap
$regex= wordwrap($regex, 80, '<br />', TRUE);
string wordwrap ( string str [, int width [, string break [, int cut]]] )
Proposed fix: ADD the following to line 249 in file /mail/sendmail.inc
(ps. check the empty 3rd element of the function, should we detect? or just use \r\n)
if (!$isHtml)
{
// Added to fix bug #1484148 for compatibility RFC2822
$message_body = wordwrap($message_body, 80, "\r\n");
$message_body = wordwrap($message_body, 998, "\r\n",true);
}
comment:3 Changed 6 years ago by lespocky
the proposed fix shown above seems to not solve the problem. the mails send with this fix are shown wordwrapped in roundcube but mail source still has no wordwrap.
btw: wordwrap should be at 72 till 78 and not at 80 chars to prevent from what we call "Kammquoting" in german. http://de.wikipedia.org/wiki/Kammquoting
The other issue is, that Mail should contain CRLF as line delimiter. So why
"\r\n"
which is differently interpreted on different OS? What about
chr(13).chr(10)
?
comment:4 Changed 6 years ago by thomasb
- Resolution set to fixed
- Status changed from new to closed
Added fix in [a23884b3].
format=flowed should be added to content-type header but this is currently not supported by PEAR::Mail_mime class

Example of such a messsage