Opened 5 years ago

Closed 5 years ago

#1484673 closed Bugs (fixed)

[PATCH] Re-opening a draft with text/plain attachment loses attachment

Reported by: tvk Owned by: till
Priority: 5 Milestone: 0.1-stable
Component: MIME parsing Version: git-master
Severity: normal Keywords:
Cc:

Description

If you re-open a draft with a text/plain (in fact, any text/*) attachment, the attachment will not be displayed and is effectively lost. I can imagine that this problem will also occur when forwarding a message with text/plain attachments, but have not tested that.

Steps to reproduce:

  1. Create a new message
  2. Add recipients, subject, some mail text
  3. Add one or more attachments of MIME type text/plain (just create a .txt file with your favourite editor)
  4. Save the message as a draft ---> attachment is saved correctly (verified on IMAP server)
  5. Go to the Drafts folder. The message will have an attachment paper clip symbol next to it.
  6. Re-open the draft
  7. The attachment is gone...

Fix:
The problem lies in roundcubemail/program/steps/mail/compose.inc:886. This if statement excludes all MIME parts of type text/* and message/* from being displayed as attachments. This is presumably done to make sure that no body part (text or html) will show up as an attachment. I would suggest instead to just check for the existence of a Content-Disposition: attachment or inline header in the MIME part. If there is one, the part should be displayed as an attachment.

Please see the attached patch against r921, which implements this.

Attachments (1)

bug-1484673-fix.patch (842 bytes) - added by tvk 5 years ago.
patch to fix this, against r921

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by tvk

patch to fix this, against r921

comment:1 Changed 5 years ago by thomasb

  • Milestone set to 0.1-stable
  • Severity changed from major to normal

Looks gut but needs so,e testing.

comment:2 Changed 5 years ago by till

  • Owner set to till
  • Status changed from new to assigned

Discovered that if I add a single attachment, but no text, the attachment is also cut off - no matter which type. This bug is fixed in [8ecb0e8f].

On to the next bug in this ticket!

comment:3 Changed 5 years ago by till

  • Resolution set to fixed
  • Status changed from assigned to closed

"Original" bug is fixed in [c3c0fb71].

Thanks for reporting this. ;-)

Note: See TracTickets for help on using tickets.