diff --git a/configure.ac b/configure.ac
index ba8fda5..432e3ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,6 +45,7 @@ m4_define([glib_minimum_version], [2.20.0])
 m4_define([gtk_minimum_version], [2.16.0])
 m4_define([eds_minimum_version], [evo_version])
 m4_define([gnome_icon_theme_minimum_version], [2.19.91])
+m4_define([gnome_desktop_minimum_version], [2.26.0])
 m4_define([libbonobo_minimum_version], [2.20.3])
 m4_define([libbonoboui_minimum_version], [2.4.2])
 m4_define([libgtkhtml_minimum_version], [3.25.4])
@@ -212,7 +213,8 @@ PKG_CHECK_MODULES([GNOME_PLATFORM],
          libgnomecanvas-2.0 >= libgnomecanvas_minimum_version
          libgnomeui-2.0 >= libgnomeui_minimum_version
          libxml-2.0 >= libxml_minimum_version
-	 shared-mime-info >= shared_mime_info_minimum_version])
+	 shared-mime-info >= shared_mime_info_minimum_version
+	 gnome-desktop-2.0 >= gnome_desktop_minimum_version])
 AC_SUBST(GNOME_PLATFORM_CFLAGS)
 AC_SUBST(GNOME_PLATFORM_LIBS)
 
@@ -1358,12 +1360,6 @@ AC_CHECK_HEADERS(libgnomeui/gnome-icon-lookup.h,,,
 	#include <libgnomeui/gnome-icon-lookup.h>
 	#endif
 ]])
-AC_CHECK_HEADERS(libgnomeui/gnome-thumbnail.h,,,
-[[
-	#if HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
-	#include <libgnomeui/gnome-thumbnail.h>
-	#endif
-]])
 CPPFLAGS="$CPPFLAGS_save"
 
 PKG_CHECK_MODULES([HAL], [hal >= hal_minimum_version], [HAVE_HAL="yes"], [HAVE_HAL="no"])
@@ -1494,7 +1490,7 @@ else
 	E_UTIL_X11_CFLAGS=""
 	E_UTIL_X11_LIBS=""
 fi
-EVO_SET_COMPILE_FLAGS(E_UTIL, libbonoboui-2.0 libglade-2.0 libgnomeui-2.0 libedataserver-$EDS_PACKAGE libedataserverui-$EDS_PACKAGE camel-$EDS_PACKAGE $mozilla_nspr, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS $E_UTIL_X11_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS $E_UTIL_X11_LIBS)
+EVO_SET_COMPILE_FLAGS(E_UTIL, libbonoboui-2.0 libglade-2.0 gnome-desktop-2.0 libedataserver-$EDS_PACKAGE libedataserverui-$EDS_PACKAGE camel-$EDS_PACKAGE $mozilla_nspr, $THREADS_CFLAGS $MANUAL_NSPR_CFLAGS $E_UTIL_X11_CFLAGS, $THREADS_LIBS $MANUAL_NSPR_LIBS $E_UTIL_X11_LIBS)
 AC_SUBST(E_UTIL_CFLAGS)
 AC_SUBST(E_UTIL_LIBS)
 
diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c
index 1336164..fed1196 100644
--- a/e-util/e-icon-factory.c
+++ b/e-util/e-icon-factory.c
@@ -30,17 +30,18 @@
 
 #include <pthread.h>
 
-#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
-#include <libgnomeui/gnome-thumbnail.h>
-#endif
-
 #include <gtk/gtk.h>
 
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnomeui/gnome-desktop-thumbnail.h>
+#undef GNOME_DESKTOP_USE_UNSTABLE_API
+
 #include "e-icon-factory.h"
 #include "e-util-private.h"
 
 #include "art/broken-image-16.xpm"
 #include "art/broken-image-24.xpm"
+
 #define d(x)
 
 typedef struct {
@@ -332,10 +333,9 @@ e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, gint width, gint height)
 	if (height <= 0)
 		height = 1;
 
-#ifdef HAVE_LIBGNOMEUI_GNOME_THUMBNAIL_H
 	/* because this can only scale down, not up */
 	if (gdk_pixbuf_get_width (pixbuf) > width && gdk_pixbuf_get_height (pixbuf) > height)
-		return gnome_thumbnail_scale_down_pixbuf (pixbuf, width, height);
-#endif
+		return gnome_desktop_thumbnail_scale_down_pixbuf (pixbuf, width, height);
+
 	return gdk_pixbuf_scale_simple (pixbuf, width, height, GDK_INTERP_BILINEAR);
 }
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 7735be8..f59dcff 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <config.h>
 #include <glib/gi18n.h>
+#include <glib/gstdio.h>
 #include <camel/camel-iconv.h>
 #include <camel/camel-data-wrapper.h>
 #include <camel/camel-mime-message.h>
@@ -31,6 +32,13 @@
 #include <camel/camel-stream-mem.h>
 #include <camel/camel-stream-null.h>
 #include <camel/camel-stream-vfs.h>
+#include <camel/camel-stream-fs.h>
+
+#include <libedataserver/e-data-server-util.h>
+
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnomeui/gnome-desktop-thumbnail.h>
+#undef GNOME_DESKTOP_USE_UNSTABLE_API
 
 #include "e-util/e-util.h"
 #include "e-util/e-mktemp.h"
@@ -99,6 +107,104 @@ enum {
 
 static gpointer parent_class;
 
+static GnomeDesktopThumbnailFactory *
+get_thumbnail_factory (void)
+{
+	static GnomeDesktopThumbnailFactory *thumbnail_factory = NULL;
+
+	if (thumbnail_factory == NULL) {
+		thumbnail_factory = gnome_desktop_thumbnail_factory_new (GNOME_DESKTOP_THUMBNAIL_SIZE_NORMAL);
+	}
+
+	return thumbnail_factory;
+}
+
+static gboolean
+create_system_thumbnail (EAttachment *attachment, GIcon **icon)
+{
+	GdkPixbuf *pixbuf = NULL;
+        struct stat file_stat;
+	GFile *file;
+        gchar *file_uri = NULL, *thumbnail = NULL;
+        gboolean is_tmp = FALSE;
+	
+	g_return_val_if_fail (attachment != NULL, FALSE);
+	g_return_val_if_fail (icon != NULL, FALSE);
+
+	file = e_attachment_get_file (attachment);
+
+	if (file && g_file_has_uri_scheme (file, "file")) {
+		gchar *path = g_file_get_path (file);
+		if (path) {
+			file_uri = g_strconcat ("file://", path, NULL);
+			g_free (path);
+		}
+        }
+
+	if (!file_uri || !g_str_has_prefix (file_uri, "file://")) {
+		g_free (file_uri);
+
+                return FALSE;
+        }
+
+	if (g_stat (file_uri + 7, &file_stat) != -1 && S_ISREG (file_stat.st_mode)) {
+		gchar *content_type, *mime = NULL;
+		gboolean uncertain = FALSE;
+
+		content_type = g_content_type_guess (file_uri + 7, NULL, 0, &uncertain);
+		if (content_type)
+			mime = g_content_type_get_mime_type (content_type);
+
+		if (mime) {
+			GnomeDesktopThumbnailFactory *th_factory;
+
+			th_factory = get_thumbnail_factory ();
+
+			thumbnail = gnome_desktop_thumbnail_factory_lookup (th_factory, file_uri, file_stat.st_mtime);
+			if (!thumbnail && gnome_desktop_thumbnail_factory_can_thumbnail (th_factory, file_uri, mime, file_stat.st_mtime)) {
+				pixbuf = gnome_desktop_thumbnail_factory_generate_thumbnail (th_factory, file_uri, mime);
+
+				if (pixbuf) {
+					gnome_desktop_thumbnail_factory_save_thumbnail (th_factory, pixbuf, file_uri, file_stat.st_mtime);
+
+					thumbnail = gnome_desktop_thumbnail_factory_lookup (th_factory, file_uri, file_stat.st_mtime);
+				}
+			}
+		}
+
+		g_free (content_type);
+		g_free (mime);
+	}
+
+	if (thumbnail) {
+		GFile *gf = g_file_new_for_path (thumbnail);
+
+		if (gf) {
+			if (*icon)
+				g_object_unref (*icon);
+
+			*icon = g_file_icon_new (gf);
+			g_object_unref (gf);
+		} else {
+			g_free (thumbnail);
+			thumbnail = NULL;
+		}
+	}
+
+	if (is_tmp) {
+                /* clear the temp */
+                g_remove (file_uri + 7);
+
+		if (thumbnail)
+			g_remove (thumbnail);
+	}
+
+	g_free (file_uri);
+	g_free (thumbnail);
+
+	return thumbnail != NULL;
+}
+
 static gchar *
 attachment_get_default_charset (void)
 {
@@ -229,6 +335,10 @@ attachment_update_icon_column (EAttachment *attachment)
 		icon = g_file_icon_new (file);
 		g_object_unref (file);
 
+	/* try the system thumbnailer */
+	} else if (create_system_thumbnail (attachment, &icon)) {
+		/* actually do nothing, just use the icon */
+
 	/* Else use the standard icon for the content type. */
 	} else if (icon != NULL)
 		g_object_ref (icon);
