[Kde-pim] KMail's quoting of text in replies and format=flowed

Jan Kundrát jkt at kde.org
Sat Nov 1 00:46:32 GMT 2014


On Saturday, 1 November 2014 00:10:26 CEST, Ingo Klöcker wrote:
> KMail doesn't know anything about "text/plain; format=flowed" messages. 

Hi Ingo,
that's right, as KMail doesn't advertise itself as a MUA which supports 
format=flowed, the current behavior is not a violation of that RFC -- one 
cannot violate a standard which one doesn't support. What I wanted to point 
out that there's an RFC which specifies how to quote e-mails, and I'm 
suggesting adopting that part of the RFC when KMail composes a mail and 
quotes some text. The fact that this definition happens to be a part of a 
RFC which speaks about format=flowed is just a coincidence (or, actually, a 
side effect of format=flowed needing a definition to use).

> (Laurent's and Christian's recent messages are "text/plain" without 
> Format specifier.) So, strictly speaking, KMail's quoting style does not 
> conflict with RFC 3676.

Indeed. On the other hand, there's no other standard that I'm aware of 
which describes how to quote in plaintext e-mails, so it seems to me that 
quoting according to RFC3676 is the best option one could do.

> Moreover, RFC 3676 reads
>   If Format is not specified, or if the value is not recognized, a value
>   of Fixed is assumed.

Yes. Trojita complies with that rule; it won't attempt to unwrap these 
lines when dealing with e-mails not marked as format=flowed.

> So, if Trojita wants to follow the RFC to the letter then it shouldn't 
> treat KMail's messages as format=flowed messages. Of course, that's not 
> what you want because usually KMail's messages are more flowed format 
> than fixed format.

The situation is even worse, actually -- certain versions of Mailman used 
to strip out the format=flowed modifier from a text/plain MIME type. That 
means that some mailing lists mangle messages in a way which makes it 
impossible to handle format=flowed. KDE's lists used to behave that way 
IIRC, but they've since been fixed by upgrading to a fixed Mailman.

> If you want Trojita to try treating text/plain messages without explicit 
> Format specifier as format=flowed messages then that's great.

I don't want to do that; as you point out, that's explicitly forbidden by 
that RFC. I suppose that this rule was put there for a reason, even though 
I might personally disaagree with it, or just not fully comprehend the 
reasoning behind it.

> But in this case you need to be forgiving in the quoting style used by the 
> client which generated the text/plain without Format message. Even if we 
> fixed KMail today, Trojita would still have to live for many years with 
> messages created by old KMails.

Yes; I could surely add a heuristic which would accept a " >" whereever a 
">" is expected, and apply that when parsing (implicitly detected) 
format=fixed. That would catch KMail-generated e-mails, but a side effect 
would be that a flowed e-mail which went through an old mailman would get 
mangled in case a line that starts with a ">" is quoted.

Anyway, I don't see a breakage too big in the way how current git master of 
Trojita renders these e-mails (see attachment) -- quotes are still shown as 
quotes, they are automatically collapsed when too long, and the only thing 
which breaks is fancy highlighting of the inner, nestes quote levels. Given 
that the e-mail is "text/plain", and hence implicitly format=fixed, Trojita 
also doesn't "violate" RFC 3676 here -- there are no rules on how to 
interpret such a mail, after all. As a user, I'm calling this behavior a 
bug, of course, but a question is whether it's a bug that could possibly be 
fixed without introducing other bugs. One can only support a limited number 
of compatibility kludges; for example, some heuristic which would catch 
quotes by "| " based on a percentage or a minimal number of these lines 
could certainly be added, but is that really worth the effort? Is it worth 
breaking e.g. rendering of e-mails where someone pastes a shell script 
which is heavy on pipes?

> Having said this, it would obviously be awesome to make some future 
> version of KMail generate proper format=flowed messages. And in this 
> case, of course, the user should not have the possibility to specify his 
> own quote character. I suppose patches are welcome.

I'm afraid I won't be able to send patches which add full support for 
composing format=flowed; that's not easy. Trojita doesn't do this 
flawlessly, either (yet). I don't know KMail inside out, but I suppose the 
scope of changes won't be any smaller than those in Trojita :(.

What I am proposing are patches which hard-code the quoting to be done 
according to format=flowed. Would that be considered acceptable, or is 
there some use case for supporting other quoting characters such as "|"? 
What use case is it?

> Hmm, looking at the "kdepim in KDE Applications 14.12" thread there's 
> definititely something broken in KMail's quoting of quoted paragraphs.

Got a picture on how it gets rendered in KMail?

With kind regards,
Jan

-- 
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trojita-kdepim-quotes.png
Type: image/png
Size: 22626 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20141101/3e592e66/attachment.png>
-------------- next part --------------
_______________________________________________
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