Bug 1666572

Summary: [Composer] Draft email can lose attachments when opened
Product: [Fedora] Fedora Reporter: Luigi Cantoni <luigic>
Component: evolutionAssignee: Milan Crha <mcrha>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 29CC: caillon+fedoraproject, lucilanga, luigic, mcrha, rhughes, rstrode, sandmann
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: evolution-3.30.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-18 10:31:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Luigi Cantoni 2019-01-16 05:14:13 UTC
Description of problem:
create new email with attachment, draft it, opeing again, attachment gone

Version-Release number of selected component (if applicable):
3.30.4 (3.30.4-1.fc29) 

How reproducible:
Always

Steps to Reproduce:
1. Create a new email
2. Add an attachment
3. Save as draft
4. Draft folder show the email with attachment
5. View the attachment while as a draft document, still OK
6. Open draft to either change or send
7. Attachment gone

Actual results:
Attachment in draft does not get sent when opened to send

Expected results:
Attachment should still be there

Additional info:
I am sure this has happened before (probably with earlier versions) but I previously though I had made an error because I did not notice it missing when send and respondents said attachment missing. Now I tested it and it failed every time. NOTE it must be an attachment not embedded.

Comment 1 Milan Crha 2019-01-16 07:11:46 UTC
Thanks for a bug report. I tried to reproduce this, but no luck, the attachment (either a .png image or a .tar.gz file) is still shown in the message composer when I reopen the draft message. I tried both HTML and Plain Text messages, with IMAP and EWS account. Maybe if you'd have more detailed steps or something.

Comment 2 Luigi Cantoni 2019-01-16 08:25:39 UTC
OK I just tried again and it worked this time.

Some slightly unusual things about my email that failed.
1) I have signature set to none. (I Just tried but that worked.)
2) I had no text in the body. (I tried that but worked too.)
3) I made the email yesterday. OK I have to now wait 24hrs to see if that might be part of it.
4) I deleted the attachment while it was in draft (mind you I could still see the contents of the attachment in the draft area). That appears not to be it but mind you maybe some buffer is holding it. Again I'll wait a day and do the normal hibernate I do at night and see if that makes a difference.
5) Maybe I closed Evolution between creating the email and when I reopened it. I'll see if that might be it too.
6) The particular attachment was .pdf (I just tried that and that does not appear to be it).

Milan, I'll work on it some more and see if I can work out what in particular causes it. It definately has happened to me several times but as I said before I thought it was me but this time I know I could see the attachment and when I opened it there was none. I then cancelled and checked the draft and it was there and I could see it etc. I opened it again and it was gone. I made the attachment an embedded image and it appeared OK and not to go away.

Like I said I'll try and get more info about the cause.

Thanks again.

Comment 3 Luigi Cantoni 2019-01-16 08:30:02 UTC
I have tracked it down probably 99% sure.
Get an email with an attachment.
Forward it.
No need to add any who just put a bit of text in the body so it has changed.
now close it.
It will offer save as draft.
Save the draft.
Open that draft and 
pesto the attachment is gone.

Comment 4 Milan Crha 2019-01-16 09:08:25 UTC
What is the forward type you use, please? If it's an attachment (the forwarded message is attached into the new message), then I'm afraid it's not it. The thing is that the structure is this:

    top message
        attachment
           forwarded message
              attachment

Thus the message preview shows two attachments. When you open the draft (double-click), it shows "only" one attachment, the forwarded message, the same as it showed it when you created the original message. I mean, the attachment in the forwarded message is still there, only not shown in the composer window, because it's not an attachment of the composed message.

You didn't tell me what your mail account type is (IMAP, EWS, ...) and where you store the Drafts (On This Computer, IMAP, EWS, ...). It can have its influence on it too. Could this be anyhow related to the attachment/message size? Like when it's larger, then it takes longer to load it and can eventually fail to add it into the composer's list of attachments? It is unlikely, I'm plain guessing here.

Comment 5 Luigi Cantoni 2019-01-17 00:19:37 UTC
Hi Milan,
I'll try and answer all your questions (sorry about the delay but the update came in after I went home, back at work now).
My evolution is set to pop emails off my server and into evolution so the emails and folders are held locally.


Reply style: inline
forward style: inline
I do a forward and the style is
new text
sig block
old header
old email
with text and sig block
------
attachment in attachment box at base.

close email (after adding some text to new email) and save as draft

In draft folder looks exactly the same
Open and it works OK.

Now the one that does not work has NO text after the old header.

If I drag that email into the INBOX and then open it it will open fine.
I think the issue is that the draft (orginal sent email) had no text in it.
I have noticed before that emails sent with no text just attachments when forwarded can sometimes loose the attachments and they have to be "replied to" and then change email address to keep the attachments.
I guess it must be to do with the format of the original email being received.

I have saved the original email as an mbox and could send you that so you could "insert" it into your inbox.
In that way it would not have been forwarded by me and you should be able to get the same problem.
Just advise the best way to give you the mbox image. (It contains no sensitive information.)

Comment 6 Milan Crha 2019-01-17 08:31:03 UTC
> I have saved the original email as an mbox and could
> send you that so you could "insert" it into your inbox.

That would be great. Just send it to my bugzilla email address and mention this bug report in the Subject, thus I'd not overlook it in my spam folder. Thanks in advance.

Comment 7 Milan Crha 2019-01-18 07:26:23 UTC
Thanks for the test message, the first worked just fine - I mean, I can reproduce the bug with it.

Comment 8 Milan Crha 2019-01-18 10:31:59 UTC
Let's move back to public. I wanted private mail only with the test message, to not expose private information in public. Every other conversation should stay open. This is open source.

The problem with your draft was that it was not created by Evolution (not a big deal, just that Evolution would not do what the other client did) and that the image had Content-ID header. This is used to recognize inline images, which are not added as attachments, but rather as inline images.

Created commit [1] in evo master (3.31.90+)
Created commit [2] in evo gnome-3-30 (3.30.5+)

[1] https://gitlab.gnome.org/GNOME/evolution/commit/63f605c410
[2] https://gitlab.gnome.org/GNOME/evolution/commit/88170825f1

Comment 9 Luigi Cantoni 2019-01-19 00:47:02 UTC
Once we worked out it started with the external (with attach/inline) item in the email created by another client I thought it might be the format of that email.
Thanks for the very quick correction.