[Kde-pim] KMail's quoting of text in replies and format=flowed
Jan Kundrát
jkt at kde.org
Fri Oct 31 17:01:42 GMT 2014
Hi,
TL;DR: I've noticed that Laurent's and Christian's recent messages to this
list are apparently created by prepending the original lines with "> ".
This conflicts with RFC 3676, and results in Trojita treating the "> >
something" as a block of text "> something" which is within a one-level
deep quote. Such mails should be only quoted by a sindle ">".
The longer version -- there's been no standard for how a quoted mail looks
like prior to RFC 2646 (nowadays RFC 3676). While ">" is a pretty standard
thing, some people use "|", maybe because it looks better on their ASCII
terminals. This lack of standardization results in all sorts of funny
artifacts, such as sometimes treating the actual greater-than sign as a
quote indicator when it happens to end up at the first character of a line,
etc. KMail attempts to deal with this through its X-KMail-QuotePrefix, but
nobody else recognize this non-standard header.
Back in 1999, an RFC defining how a MIME type "text/plain; format=flowed"
looks like, and the only allowed quote character is ">". There's an example
[1] which clearly says that no spaces are allowed within the quote marks.
Nothing is wrong with quoting "a text" as "> a text", but quoting "> a
text" *must* be done as ">> a text" and *not* as "> > a text". The
underlying mechanism is called "space stuffing".
I would like to propose removing support for specifying the quote character
in KMail's configuration templates. The goal is to increase
interoperability by making sure it produces e-mails that conform to the
oficially blessed counting style.
A correct change would be rather complex; one should track whether each
line is quoted or not when processing them, and not rely on the leading ">"
of the actual line content. The algorithm which we use in Trojita is
available in UiUtils::plaintextToHtml at [2]. Trojita's composer is still a
bit broken, it won't space-stuff lines which happen to start with a ">"
correctly, so they end up as quoterd. In order to change this, each
paragraph in the composer will have to maintain its quote level
out-of-band, and that is something which still remains to be done for
Trojita.
A little easier (and also dirtier) fix for KMail would be to check whether
each line starts with a ">" already, and only quote these with another ">".
Every other line should still be quoted by a "> ". This algorithm is prone
to false quoting, but it's an improvement on what KMail does today.
I wonder what's your opinion on this one. I could help with some patches
for the quick&dirty approach if you like the direction. I guess that
removing the GUI and functionality but leaving the accessors (if any) etc
in place is the way to go?
With kind regards,
Jan
[1] http://tools.ietf.org/html/rfc2646#section-4.5
[2]
http://quickgit.kde.org/?p=trojita.git&a=blob&h=c1fefa0a13969d8461ebc6ee7c5be2a891ce97f2&hb=7ded880c12dac7dfc1f97a1c7f4e4de09a80d917&f=src%2FUiUtils%2FPlainTextFormatter.cpp
, line 209
--
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list