Index: configure.in
===================================================================
--- configure.in	(revision 1619)
+++ configure.in	(working copy)
@@ -7,7 +7,7 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PAC
 
 # Required Package Versions
 m4_define([camel_minimum_version], [2.21.90])
-m4_define([glib_minimum_version], [2.15.3])
+m4_define([glib_minimum_version], [2.16.0])
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([gconf_minimum_version], [2.0.0])             # XXX Just a Guess
 m4_define([libbonobo_minimum_version], [2.20.3])
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 1619)
+++ ChangeLog	(working copy)
@@ -1,3 +1,11 @@
+2008-04-07  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #526740
+
+	* configure.in: Require minimum GLib 2.16.0.
+	* calendar/e-cal-backend-exchange.c: (get_mime_type), (build_msg):
+	Drop dependency on gnome-vfs, use new gio instead.
+
 2008-04-01  Matthew Barnes  <mbarnes@redhat.com>
 
 	* configure.in: Version bump for 2.23.1.
Index: calendar/e-cal-backend-exchange.c
===================================================================
--- calendar/e-cal-backend-exchange.c	(revision 1619)
+++ calendar/e-cal-backend-exchange.c	(working copy)
@@ -30,7 +30,7 @@
 #include <unistd.h>
 #include <libedataserver/e-time-utils.h>
 
-#include <libgnomevfs/gnome-vfs-mime-utils.h>
+#include <gio/gio.h>
 
 #include <camel/camel-mime-message.h>
 #include <camel/camel-multipart.h>
@@ -1756,6 +1756,33 @@ process_delegated_cal_object (icalcompon
 	}
 }
 
+static char *
+get_mime_type (const char *uri)
+{
+	GFile *file;
+	GFileInfo *fi;
+	char *mime_type;
+
+	g_return_val_if_fail (uri != NULL, NULL);
+
+	file = g_file_new_for_uri (uri);
+	if (!file)
+		return NULL;
+
+	fi = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	if (!fi) {
+		g_object_unref (file);
+		return NULL;
+	}
+
+	mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (fi));
+
+	g_object_unref (fi);
+	g_object_unref (file);
+
+	return mime_type;
+}
+
 char *
 build_msg ( ECalBackendExchange *cbex, ECalComponent *comp, const char *subject, char **boundary)
 {
@@ -1834,10 +1861,14 @@ build_msg ( ECalBackendExchange *cbex, E
 		camel_data_wrapper_construct_from_stream (wrapper, stream);
 		camel_object_unref (stream);
 
-		mime_type = gnome_vfs_get_mime_type (dest_url + strlen ("file://"));
-		type = camel_content_type_decode (mime_type);
-		camel_data_wrapper_set_mime_type_field (wrapper, type);
-		camel_content_type_unref (type);
+		
+		mime_type = get_mime_type (dest_url);
+		if (mime_type) {
+			type = camel_content_type_decode (mime_type);
+			camel_data_wrapper_set_mime_type_field (wrapper, type);
+			camel_content_type_unref (type);
+			g_free (mime_type);
+		}
 
 		mime_part = camel_mime_part_new ();
 
