Bug 3824

Summary: Quotation Folding is wrongly applied to text attachments
Product: Claws Mail (GTK 2) Reporter: lbickley <lbickley>
Component: OtherAssignee: users
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: other   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Attachment that got modified on being sent
none
Same as txt file - but zipped
none
mail as requested by Paul none

Description lbickley 2017-05-19 03:08:41 UTC
version 3.15.0git17
GTK+ 2.24.31 / GLib 2.48.2
Locale: en_US.UTF-8 (charset: UTF-8)
Operating System: Linux 4.4.62-18.6-default (x86_64)



I attached a text file containing the following Python TensorFlow test program:
-------------------------------------------------
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow')
>>> sess = tf.Session()
>>> print(sess.run(hello))
'Hello, TensorFlow'
-------------------------------------------------
What was actually sent was:

[...]
'Hello, TensorFlow'
-------------------------------------------------

Bug: Claws is incorrectly scanning text attachments and treating them as email thereby assuming that embedded ">" are versions of email to be bracketed.
Comment 1 Paul 2017-05-19 07:18:52 UTC
In order to help understand what you are describing, please attach an example message file.
Comment 2 lbickley 2017-05-19 14:23:53 UTC
Created attachment 1750 [details]
Attachment that got modified on being sent

When I sent this text as an attachment - the tensorflow lines with >>> got modified to [...]
Comment 3 lbickley 2017-05-19 14:28:33 UTC
Created attachment 1751 [details]
Same as txt file - but zipped

Here's a ZIP of the previously attached TXT file...
Comment 4 Paul 2017-05-19 14:51:44 UTC
The attachments are the file you attached, what I want to see is the whole message file.
Comment 5 Paul 2017-05-19 14:52:43 UTC
The content of attachment 1751 [details] has been deleted by
    Paul <paul@claws-mail.org>
who provided the following reason:

same as other attachment, but zipped

The token used to delete this attachment was generated at 2017-05-19 16:52:19 CEST.
Comment 6 lbickley 2017-05-20 02:06:32 UTC
Hi Paul,

An easy test would be to email the attachment (unzipped as txt) to yourself. You'll see the bug right away. You can look in your "send" folder or wait until you receive it. It will be obvious.

Cheers,
Lyle
Comment 7 Paul 2017-05-20 09:34:37 UTC
Works fine here. I think you have probably inserted the file rather than attached it. If you attach your message file to this bug item then that could be determined for certain, I think.
Comment 8 lbickley 2017-05-20 14:25:04 UTC
Created attachment 1752 [details]
mail as requested by Paul

I see that in the "saved" email, the "/// --source---" is correct - but when I "click" on the sent attachment to view it I get :
----

Python 3.4.5 (default, Jul 03 2016, 12:57:15) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
 [...]  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sess' is not defined
 [...]  
2017-05-18 19:30:22.772159: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and c

---

So the problem ("[...]" which should be "/// something") appears to be in the DISPLAY of the attachment as opposed to the attachment itself.
Comment 9 Paul 2017-05-20 14:53:48 UTC
That appears that it might be related to the python plugin, which I do not use. Do you have that loaded? It all works exactly as expected here.
Comment 10 Paul 2017-05-20 14:57:39 UTC
I take that back. The bit of text you pasted is just from that file.
The '[...]' you see is because you are collpasing quotations. So, if anything, the quotation collapser is being a bit over enthusiastic, in that it's collapsing part of the attached text file.
Comment 11 lbickley 2017-05-20 15:39:12 UTC
Yes, that's what I thought "an overly aggressive quotation collapser" - although I made the mistake of assuming what I was seeing when I viewed the attachment was what was actually sent ;)

BTW: The only plugins I have loaded are: "Fancy HTML Viewer", "Gdata" and "PGP/Core"
Comment 12 lbickley 2017-05-22 20:20:02 UTC
Paul - would you please mark this as unresolved/valid - as Claws is displaying "sent" emails incorrectly. Perhaps you/I should rename the bug to "Claws is compressing the display of sent messages"?
Comment 13 lbickley 2017-05-23 16:25:56 UTC
I modified the subject line to more aptly define the bug.
Comment 14 users 2017-05-31 18:40:02 UTC
Changes related to this bug have been committed.
Please check latest Git and update the bug accordingly.
You can also get the patch from:
http://git.claws-mail.org/

++ ChangeLog	2017-05-31 20:40:02.287752588 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=45cbd9a2abd3ad72a830e3a1ba0950d5bebfd738
Merge: 567b7e7 61ec4ca
Author: Colin Leroy <colin@colino.net>
Date:   Wed May 31 20:40:01 2017 +0200

    Merge branch 'master' of file:///home/git/claws

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=61ec4cae4410ebe0ecb652c7c96000301950ecc8
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Wed May 31 20:38:59 2017 +0200

    Do not try to handle quotes in text attachments.
    
    Closes Bug 3824 - Quotation Folding is wrongly applied to text
    attachments.
Comment 15 Andrej Kacian 2017-05-31 18:43:38 UTC
Fixed now in git, thanks for the report!
Comment 16 lbickley 2017-05-31 23:42:20 UTC
Just updated from git. Now at version 3.15.0git17.

Bug still present as shown in test case attachment.

Segment of txt attachment that's correct (from message source):
--
Python 3.4.5 (default, Jul 03 2016, 12:57:15) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello =3D tf.constant('Hello, TensorFlow')
>>> sess - tf.Session()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sess' is not defined
>>> sess =3D tf.Session()
2017-05-18 19:30:22.772159: W tensorflow/core/platform/cpu_feature_guard.cc=
:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but=
 these are available on your machine and could speed up CPU computations.
2017-05-18 19:30:22.772179: W tensorflow/core/platform/cpu_feature_guard.cc
--

Same segment shown by viewing "sent":
--
Python 3.4.5 (default, Jul 03 2016, 12:57:15) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
 [...]  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sess' is not defined
 [...]  
2017-05-18 19:30:22.772159: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-18 19:30:22.772179: W tensorflow/core/platform/cpu_feature_guard.cc
--

Note that in the  attachment ">>>" (part of python script) was incorrectly identified as requiring folding - when as an attachment it should not have been so  processed!
Comment 17 Paul 2017-06-01 07:29:27 UTC
This works for text attachments which have 'Content-Disposition: attachment' (this is what is fixed). Text attachments which have 'Content-Disposition: inline' are treated like inline text.
Comment 18 lbickley 2017-06-08 22:17:36 UTC
I've been trying to live with this - but it seems to me to be a bug. If this is not going to be fixed, is there a way to turn folding off and revert to:

> last
>> prior to last
>>> prior to last
>>>> etc.