Bug 3028 - Claws doesn't select html part if attachments present
Summary: Claws doesn't select html part if attachments present
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: UI/Message View (show other bugs)
Version: 3.9.2
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2013-11-06 15:15 UTC by Stan
Modified: 2016-02-19 18:55 UTC (History)
2 users (show)

See Also:


Attachments
possible fix (8.76 KB, patch)
2015-12-17 11:05 UTC, Ricardo Mones
mones: applied+
Details | Diff

Description Stan 2013-11-06 15:15:37 UTC
I have Claws set to automatically select the html part of messages which works except when there are file attachments (say a PDF) to the email in which case the plain text message opens instead.
Comment 1 Paul 2013-11-06 15:34:01 UTC
Please forward an example message to me, use "forward as attachment"
Comment 2 Stan 2013-11-06 16:43:28 UTC
Done.

Appears to happen when the html message has images in it. Attaching a file alone doesn't trigger it.
Comment 3 Ricardo Mones 2015-12-15 16:37:15 UTC
Just tested git version with images (one or several) and non-image files and automatic HTML selection always worked, hence closing.
Comment 4 Paul 2015-12-15 17:14:28 UTC
I was able to verify this with the example message provided.
Comment 5 Ricardo Mones 2015-12-16 10:33:05 UTC
Not showing the structure of the provided message, but seems a duplicate of #2787.

*** This bug has been marked as a duplicate of bug 2787 ***
Comment 6 Ricardo Mones 2015-12-16 11:19:59 UTC
Seems I've found some valid structure in a real mail which matches this description, hence reopening. Sorry for the bug bashing ;-)

message/rfc822
└─multipart/mixed
  ├─multipart/related
  │ ├─multipart/alternative
  │ │ ├─text/plain
  │ │ └─text/html  
  │ └─image/gif
  └─application/octet-stream
Comment 7 Ricardo Mones 2015-12-17 11:05:48 UTC
Created attachment 1618 [details]
possible fix

This patch seems to fix the issue to me, while maintaining current functionality:

• display first HTML part
• promotion of calendar attachments (if vcalendar is available)
• not promoting HTML attachments

Fix makes the search fully recursive, as suggested by Abhay in bug #2787 ;-)

Said that, is simple tail recursion, so feel free to convert to iterative…

It probably needs some polishing too, but given the date, that could be done post release…
Comment 8 Marcel van der Boom 2015-12-17 11:25:28 UTC
FYI: I applied the patch and for my usecase (Paul has a copy of the message) this works fine.
Comment 9 users 2016-02-19 18:55: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	2016-02-19 18:55:02.422993911 +0100
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=be795f6cd7b82d65fc9c0f16f3dd24b204a3b0b7
Merge: 2d2c42e 4745b80
Author: Colin Leroy <colin@colino.net>
Date:   Fri Feb 19 18:55:01 2016 +0100

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

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=4745b80528426498b9e4f61d0f1a812e94ce1a6e
Author: Ricardo Mones <ricardo@mones.org>
Date:   Fri Feb 19 18:50:04 2016 +0100

    Fix bug #3028: Claws doesn't select html part if attachments present
    
    Make HTML part search recursive maintaining current functionality:
    • display first HTML part
    • promotion of calendar attachments (if vCalendar is available)
    • not promoting HTML attachments

Note You need to log in before you can comment on or make changes to this bug.