After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 532987 - Evolution doesn't allow me to open mbox attachments inline
Evolution doesn't allow me to open mbox attachments inline
Status: RESOLVED DUPLICATE of bug 464131
Product: evolution
Classification: Applications
Component: Mailer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2008-05-13 18:22 UTC by Bastien Nocera
Modified: 2009-06-15 15:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mbox-files.mbox (8.91 KB, text/plain)
2008-05-13 18:23 UTC, Bastien Nocera
Details

Description Bastien Nocera 2008-05-13 18:22:36 UTC
evolution-2.22.1-2.fc9.x86_64
evolution-data-server-2.22.1-2.fc9.x86_64

The attached mail was sent by me using Evolution. The patches are marked as mbox files (which they are), but Evolution doesn't allow me to look into them, even though they're sub-class of text/plain in shared-mime-info.

The only action that Evolution allows me to take is to save the file, but they could also be opened by:
1) Evolution itself (as messages)
2) Any text editor (as they support text/plain)
Comment 1 Bastien Nocera 2008-05-13 18:23:02 UTC
Created attachment 110863 [details]
mbox-files.mbox
Comment 2 Srinivasa Ragavan 2008-05-23 10:02:55 UTC
Bastien, Evolution doesn't register itself as a handler. Another thing is that Evolution uses GIO to get the apps for mime types. This bug may have to go GIO then.

Comment 3 Bastien Nocera 2008-05-23 10:33:46 UTC
Nothing to do with GIO, the applications don't have a separate mime-types list for GIO. Where does that code to determine which application handles the mime-type live?
Comment 4 Srinivasa Ragavan 2008-05-23 11:21:30 UTC
Bastien,

Look at em-popup.c

apps = g_app_info_get_all_for_type (mime_type);
...
...
...
for (l = apps, i = 0; l; l = l->next, i++) {
   GAppInfo *app = l->data;
   EPopupItem *item;

   if (!g_app_info_should_show (app)) {
      g_object_unref (app);
      l->data = NULL;
      continue;
   }

...
...

THis is how we get the list of apps for the mime type. Mime type is extracted from the mail content-type which is application/mbox.
Comment 5 Bastien Nocera 2008-05-23 11:52:33 UTC
$ cat test.c
#include <gio/gio.h>

int main (int argc, char **argv)
{
	GList *list, *l;

	g_type_init ();

	list = g_app_info_get_all_for_type ("application/mbox");
	for (l = list; l != NULL; l = l->next) {
		GAppInfo *info = l->data;

		g_message ("name: %s (show? %d)", g_app_info_get_name (info), g_app_info_should_show (info));
	}

	return 0;
}
$ gcc -o test test.c `pkg-config --cflags --libs gio-2.0`
$ ./test 
** Message: name: Text Editor (show? 1)
** Message: name: AbiWord (show? 1)

So the text editor and abiword should show up in the list on my system, but they don't. I guess this is a problem with gnome-vfs as I'm using evo 2.22. Can you confirm it works as expected with 2.23? (popup offers to open in text editor, *and* can be opened using the disclosure triangle)
Comment 6 Srinivasa Ragavan 2008-05-23 18:46:02 UTC
Dropdown gives gedit and a huge list of editors.

But it doesn't allow to view inline. May be, this can be handled in evolution. text/plain handler should be registered for application/mbox also, which should solve it. 
Comment 7 Bastien Nocera 2008-05-23 23:08:47 UTC
(In reply to comment #6)
> Dropdown gives gedit and a huge list of editors.
> 
> But it doesn't allow to view inline. May be, this can be handled in evolution.
> text/plain handler should be registered for application/mbox also, which should
> solve it. 

The easiest way is to use:
if (g_content_type_is_a (mimetype, "text/plain") != FALSE) {
  /* Do stuff to allow showing the attachment inline */
}

Obviously that needs to be the last resort option, otherwise vCards and the likes would be handled as text. Doing it that way all the text type files would be showing up without any special casing code (compared to adding application/mbox as a special type).

Additionally, application/mbox files should appear the same way forwarded messages do, as they contain From:, Subject:, etc. headers already.
Comment 8 Matthew Barnes 2009-06-15 15:51:09 UTC
Working on this under bug #464131.

*** This bug has been marked as a duplicate of 464131 ***