Bug 3246 - attachment open: "remember this" ignored if ~/.mailcap does not exist
Summary: attachment open: "remember this" ignored if ~/.mailcap does not exist
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: UI (show other bugs)
Version: 3.10.1
Hardware: PC Linux
: P3 normal
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2014-08-11 16:20 UTC by Klaus Kusche
Modified: 2014-08-21 10:26 UTC (History)
0 users

See Also:


Attachments
Fix proposal. (1.34 KB, patch)
2014-08-13 15:01 UTC, Ricardo Mones
no flags Details | Diff

Description Klaus Kusche 2014-08-11 16:20:52 UTC
When opening an attachment (no matter whether by clicking on "open"
in the main view, selecting open in the attachment's context menu,
or middle clicking on the attachment), the dialog for choosing
the application comes up.

But even when selecting "remember this", the choice is *not* remembered:
When opening another attachment of the same type, or even the same attachment again, the choice dialog comes up again.

Hence, it is not possible to open attachments with a single click,
it always requires several steps, which is very annoying.

The problem does not depend on the type of the attachment,
same problem for pdf, doc, ...
Comment 1 Paul 2014-08-13 11:00:36 UTC
This is remembered based on the MIME type. In your case the MIME type is "application/octet-stream" which is generic and undefined, therefore the choice is not remembered.
Comment 2 Klaus Kusche 2014-08-13 11:20:51 UTC
Wrong.

The type is shown as "application/pdf", "application/msword",
"application/vnd.ms-excel" and so on, but the choice is still
not remembered for those types.

And even if the type were "application/octet-stream",
claws should remember "xdg-open %s" (or whatever I enter)
when I select "Remember this".
This is a good generic choice, and if I don't like it
for a specific attachment, I can always override it
by selecting "Open with" instead of "Open".
Comment 3 Paul 2014-08-13 11:33:35 UTC
OK, but I had to make an assumption as the information provided was sparse.

See http://www.claws-mail.org/faq/index.php/Installation_and_Configuration#How_can_I_select_different_applications_to_open_with_specific_MIME_types.3F

When you use 'remember this' Claws writes to ~/.mailcap. How this file is used depends on your distro.
Comment 4 Klaus Kusche 2014-08-13 13:54:13 UTC
Well, the bug is that claws did *not* write to ~/.mailcap,
because that file did not exist, and claws did not create it.

Please make sure that claws *creates* the file if "remember this"
is selected and the file does not yet exist!

After a "touch ~/.mailcap", everything works as expected,
but it should not be necessary to do that by hand.
Comment 5 Ricardo Mones 2014-08-13 15:01:45 UTC
Created attachment 1424 [details]
Fix proposal.
Comment 6 users 2014-08-19 20:02: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	2014-08-19 20:02:02.617997192 +0200
http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=5f51db94774e67c7e6b8f32611d62f957c2c9972
Merge: 681b34b f1fd770
Author: Colin Leroy <colin@colino.net>
Date:   Tue Aug 19 20:02:02 2014 +0200

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

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=f1fd770f62d2239bfc0f4ad0e8369f30c370b789
Author: Ricardo Mones <ricardo@mones.org>
Date:   Wed Aug 13 23:27:14 2014 +0200

    Improve translation (Debian bug #757929)

http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=7a114d508a42a8d7282011a2c46cf8aa7aa4eaef
Author: Ricardo Mones <ricardo@mones.org>
Date:   Tue Aug 19 17:17:30 2014 +0200

    Fix bug #3246 ‘attachment open: "remember this" ignored if ~/.mailcap does not exist’
    
    Add also a warning if intermediate file cannot be created.

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