Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 2735)
+++ src/Makefile.am	(working copy)
@@ -28,6 +28,10 @@
 build_libtrackergtk = libtracker-gtk
 endif
 
+if HAVE_EVOPLUG
+build_evoplug = tracker-evolution-plugin
+endif
+
 SUBDIRS = 					\
 	libstemmer				\
 	$(build_qdbm)				\
@@ -44,7 +48,8 @@
 	$(build_libtrackergtk)			\
 	$(build_tracker_applet)			\
 	$(build_tracker_search_tool)		\
-	$(build_tracker_preferences)
+	$(build_tracker_preferences)		\
+	$(build_evoplug)
 
 DIST_SUBDIRS = 					\
 	libstemmer				\
@@ -62,4 +67,5 @@
 	libtracker-gtk				\
 	tracker-applet	 			\
 	tracker-search-tool			\
-	tracker-preferences
+	tracker-preferences			\
+	tracker-evolution-plugin
Index: src/tracker-evolution-plugin/tracker-evolution-plugin.h
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-plugin.h	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-plugin.h	(revision 0)
@@ -0,0 +1,64 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#ifndef __TRACKER_EVOLUTION_PLUGIN_H__
+#define __TRACKER_EVOLUTION_PLUGIN_H__
+
+#if !defined (TRACKER_ENABLE_INTERNALS) && !defined (TRACKER_COMPILATION)
+#error "TRACKER_ENABLE_INTERNALS not defined, this must be defined to use tracker's internal functions"
+#endif
+
+#include <glib.h>
+#include <dbus/dbus-glib-bindings.h>
+
+#include <libtracker-common/tracker-common.h>
+
+#include "tracker-evolution-common.h"
+
+#define TRACKER_TYPE_EVOLUTION_PLUGIN          (tracker_evolution_plugin_get_type())
+#define TRACKER_EVOLUTION_PLUGIN(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_EVOLUTION_PLUGIN, TrackerEvolutionPlugin))
+#define TRACKER_EVOLUTION_PLUGIN_CLASS(c)      (G_TYPE_CHECK_CLASS_CAST ((c), TRACKER_TYPE_EVOLUTION_PLUGIN, TrackerEvolutionPluginClass))
+#define TRACKER_EVOLUTION_PLUGIN_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_EVOLUTION_PLUGIN, TrackerEvolutionPluginClass))
+
+G_BEGIN_DECLS
+
+typedef struct TrackerEvolutionPlugin TrackerEvolutionPlugin;
+typedef struct TrackerEvolutionPluginClass TrackerEvolutionPluginClass;
+
+struct TrackerEvolutionPlugin {
+	GObject parent;
+};
+
+struct TrackerEvolutionPluginClass {
+	GObjectClass parent;
+};
+
+GType tracker_evolution_plugin_get_type (void);
+
+void tracker_evolution_plugin_register  (TrackerEvolutionPlugin *object, 
+										 guint64 last_checkout, 
+										 DBusGMethodInvocation *context);
+
+G_END_DECLS
+
+#endif /* __TRACKER_EVOLUTION_PLUGIN_H__ */
Index: src/tracker-evolution-plugin/tracker-evolution.h
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution.h	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution.h	(revision 0)
@@ -0,0 +1,42 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#ifndef __LIBTRACKER_EVOLUTION_H__
+#define __LIBTRACKER_EVOLUTION_H__
+
+#if !defined (TRACKER_ENABLE_INTERNALS) && !defined (TRACKER_COMPILATION)
+#error "TRACKER_ENABLE_INTERNALS not defined, this must be defined to use tracker's internal functions"
+#endif
+
+#include <glib.h>
+
+#include <libtracker-common/tracker-common.h>
+
+G_BEGIN_DECLS
+
+void  tracker_evolution_init     (TrackerConfig *config);
+void  tracker_evolution_shutdown (void);
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_EVOLUTION_H__ */
Index: src/tracker-evolution-plugin/tracker-evolution-registrar.h
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-registrar.h	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-registrar.h	(revision 0)
@@ -0,0 +1,80 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#ifndef __LIBTRACKER_EVOLUTION_REGISTRAR_H__
+#define __LIBTRACKER_EVOLUTION_REGISTRAR_H__
+
+#if !defined (TRACKER_ENABLE_INTERNALS) && !defined (TRACKER_COMPILATION)
+#error "TRACKER_ENABLE_INTERNALS not defined, this must be defined to use tracker's internal functions"
+#endif
+
+#include <glib.h>
+#include <dbus/dbus-glib-bindings.h>
+
+#include "tracker-evolution-common.h"
+
+G_BEGIN_DECLS
+
+#define TRACKER_TYPE_EVOLUTION_REGISTRAR          (tracker_evolution_registrar_get_type())
+#define TRACKER_EVOLUTION_REGISTRAR(o)            (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_EVOLUTION_REGISTRAR, TrackerEvolutionPlugin))
+#define TRACKER_EVOLUTION_REGISTRAR_CLASS(c)      (G_TYPE_CHECK_CLASS_CAST ((c), TRACKER_TYPE_EVOLUTION_REGISTRAR, TrackerEvolutionPluginClass))
+#define TRACKER_EVOLUTION_REGISTRAR_GET_CLASS(o)  (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_EVOLUTION_REGISTRAR, TrackerEvolutionRegistrarClass))
+
+G_BEGIN_DECLS
+
+typedef struct TrackerEvolutionRegistrar TrackerEvolutionRegistrar;
+typedef struct TrackerEvolutionRegistrarClass TrackerEvolutionRegistrarClass;
+
+struct TrackerEvolutionRegistrar {
+	GObject parent;
+};
+
+struct TrackerEvolutionRegistrarClass {
+	GObjectClass parent;
+};
+
+GType  tracker_evolution_registrar_get_type   (void);
+
+void  tracker_evolution_registrar_set         (TrackerEvolutionRegistrar *object, 
+					       const gchar *subject, 
+					       const GStrv predicates,
+					       const GStrv values,
+					       DBusGMethodInvocation *context);
+void  tracker_evolution_registrar_set_many    (TrackerEvolutionRegistrar *object, 
+					       const GStrv subjects, 
+					       const GPtrArray *predicates,
+					       const GPtrArray *values,
+					       DBusGMethodInvocation *context);
+void  tracker_evolution_registrar_unset_many  (TrackerEvolutionRegistrar *object, 
+					       const GStrv subjects, 
+					       DBusGMethodInvocation *context);
+void  tracker_evolution_registrar_unset       (TrackerEvolutionRegistrar *object, 
+					       const gchar *subject, 
+					       DBusGMethodInvocation *context);
+void  tracker_evolution_registrar_cleanup     (TrackerEvolutionRegistrar *object, 
+					       DBusGMethodInvocation *context);
+
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_EVOLUTION_REGISTRAR_H__ */
Index: src/tracker-evolution-plugin/tracker-evolution-plugin.xml
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-plugin.xml	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-plugin.xml	(revision 0)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node name="/">
+  <interface name="org.gnome.evolution.metadata.Manager">  
+    <method name="Register">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="t" name="last_checkout" direction="in" />
+    </method>
+  </interface>
+</node>
+
Index: src/tracker-evolution-plugin/liborg-freedesktop-Tracker-evolution-plugin.eplug.xml
===================================================================
--- src/tracker-evolution-plugin/liborg-freedesktop-Tracker-evolution-plugin.eplug.xml	(revision 0)
+++ src/tracker-evolution-plugin/liborg-freedesktop-Tracker-evolution-plugin.eplug.xml	(revision 0)
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<e-plugin-list>
+	<e-plugin id="org.freedesktop.Tracker.evolution_plugin" 
+		type="shlib"
+		location="+EVOPLUG_INSTALL_DIR+/liborg-gnome-sa-junk-plugin.so"
+		domain="+GETTEXT_PACKAGE+"
+		localedir="+LOCALEDIR+"
+		_name="TrackerEvolutionPlugin">
+
+		<_description>Enables support for Tracker.</_description>
+
+		<author name="Philip Van Hoof" email="philip@codeminded.be"/>
+
+		<!-- hook into the Junk mail filtering -->
+		<hook class="org.gnome.evolution.mail.junk:1.0">
+			<group id="EMJunk" >
+				<item   name="SpamAssassin" 
+				        check_junk="org_freedesktop_Tracker_check_junk" 
+				        report_junk="org_freedesktop_Tracker_report_junk" 
+					report_non_junk="org_freedesktop_Tracker_report_non_junk" 
+					commit_reports="org_freedesktop_Tracker_commit_reports"
+					validate_binary="org_freedesktop_Tracker_validate_binary"/>
+			</group>
+		</hook>
+
+		<!-- hook into the 'mail properties' menu -->
+		<hook class="org.gnome.evolution.mail.config:1.0">
+			<group target="prefs" id="org.gnome.evolution.mail.prefs">
+				<item type="section_table" path="50.tracker/10.options" _label="Tracker Options"/>
+				<item type="item_table" path="50.tracker/20.options" factory="org_freedesktop_Tracker_use_tracker"/>
+			</group>
+		</hook>
+
+		<hook class="org.gnome.evolution.mail.config:1.0">
+			<group target="account" id="org.gnome.evolution.mail.config.accountWizard" 
+				commit="backup_restore_commit" abort="backup_restore_abort">
+				<item type="page" path="0.startup_page.10" factory="backup_restore_page"/>
+			</group>
+		</hook>
+
+	</e-plugin>
+</e-plugin-list>
Index: src/tracker-evolution-plugin/tracker-evolution-common.h
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-common.h	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-common.h	(revision 0)
@@ -0,0 +1,39 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#ifndef __TRACKER_EVOLUTION_COMMON_H__
+#define __TRACKER_EVOLUTION_COMMON_H__
+
+#if !defined (TRACKER_ENABLE_INTERNALS) && !defined (TRACKER_COMPILATION)
+#error "TRACKER_ENABLE_INTERNALS not defined, this must be defined to use tracker's internal functions"
+#endif
+
+#define TRACKER_EVOLUTION_REGISTRAR_SERVICE      "org.gnome.evolution"
+#define TRACKER_EVOLUTION_REGISTRAR_PATH         "/org/gnome/evolution/metadata/Registrar"
+#define TRACKER_EVOLUTION_REGISTRAR_INTERFACE   "org.gnome.evolution.metadata.Registrar"
+
+#define TRACKER_EVOLUTION_MANAGER_SERVICE      "org.gnome.evolution"
+#define TRACKER_EVOLUTION_MANAGER_PATH         "/org/gnome/evolution/metadata/Manager"
+#define TRACKER_EVOLUTION_MANAGER_INTERFACE    "org.gnome.evolution.metadata.Manager"
+
+#endif /* __TRACKER_EVOLUTION_COMMON_H__ */
Index: src/tracker-evolution-plugin/Makefile.am
===================================================================
--- src/tracker-evolution-plugin/Makefile.am	(revision 0)
+++ src/tracker-evolution-plugin/Makefile.am	(revision 0)
@@ -0,0 +1,74 @@
+INCLUDES =						\
+	-I$(top_srcdir)/src				\
+	-DGETTEXT_PACKAGE="\"$(GETTEXT_PACKAGE)\""	\
+	-DLOCALEDIR="\"$(LOCALEDIR)\""			\
+	-DTRACKER_COMPILATION				\
+	$(DBUS_CFLAGS)					\
+	$(EVOPLUG_CFLAGS)
+
+%.eplug.in: %.eplug.xml
+	LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< $@
+
+%.eplug: %.eplug.in
+	sed -e "s%+PLUGIN_INSTALL_DIR+%$(EVOPLUG_INSTALL_DIR)%" \
+	-e "s%+GETTEXT_PACKAGE+%$(GETTEXT_PACKAGE)%" \
+	-e "s%+LOCALEDIR+%$(LOCALEDIR)%" \
+	$< > $@
+
+eplugindir = $(EVOPLUG_INSTALL_DIR)
+
+eplugin_DATA = liborg-freedesktop-Tracker-evolution-plugin.eplug
+
+eplugin_LTLIBRARIES = liborg-freedesktop-Tracker-evolution-plugin.la
+
+noinst_LTLIBRARIES = libtracker-evolution.la
+
+libtracker_evolution_la_SOURCES =	 				\
+	tracker-evolution.c						\
+	tracker-evolution.h						\
+	tracker-evolution-registrar.c					\
+	tracker-evolution-registrar.h					\
+	tracker-evolution-common.h					\
+	tracker-evolution-registrar-glue.h
+
+liborg_freedesktop_Tracker_evolution_plugin_la_SOURCES = 		\
+	tracker-evolution-plugin.c 			 		\
+	tracker-evolution-plugin.h					\
+	tracker-evolution-common.h					\
+	$(marshal_sources)						\
+	tracker-evolution-plugin-glue.h
+
+liborg_freedesktop_Tracker_evolution_plugin_la_LDFLAGS = -module -avoid-version
+liborg_freedesktop_Tracker_evolution_plugin_la_LDLIBS = 		\
+	$(EVOPLUG_LIBS)							\
+	$(DBUS_LIBS)
+
+dbus_sources = 								\
+	tracker-evolution-plugin-glue.h					\
+	tracker-evolution-registrar-glue.h
+
+%-glue.h: %.xml
+	$(DBUSBINDINGTOOL) --mode=glib-server --output=$@ --prefix=$(subst -,_,$*) $^
+
+tracker-evolution-marshal.h: tracker-evolution-marshal.list
+	$(GLIB_GENMARSHAL) $< --prefix=tracker_evolution_marshal --header > $@ 
+
+tracker-evolution-marshal.c: tracker-evolution-marshal.list
+	$(GLIB_GENMARSHAL) $< --prefix=tracker_evolution_marshal --body > $@
+
+marshal_sources =							\
+	tracker-evolution-marshal.h					\
+	tracker-evolution-marshal.c
+
+BUILT_SOURCES = 							\
+	$(dbus_sources)							\
+	$(marshal_sources)						\
+	$(eplugin_DATA)
+
+CLEANFILES = $(BUILT_SOURCES) \
+	liborg-freedesktop-Tracker-evolution-plugin.eplug
+
+EXTRA_DIST = 								\
+	$(BUILT_SOURCES)						\
+	tracker-evolution-marshal.list					\
+	org-freedesktop-Tracker-evolution-plugin.eplug.xml
Index: src/tracker-evolution-plugin/tracker-evolution-plugin.c
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-plugin.c	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-plugin.c	(revision 0)
@@ -0,0 +1,690 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
+#include <pthread.h>
+#include <signal.h>
+#include <time.h>
+
+#include <camel/camel-mime-message.h>
+#include <camel/camel-i18n.h>
+#include <mail/em-junk-hook.h>
+#include <mail/em-utils.h>
+#include <camel/camel-store.h>
+#include <camel/camel-db.h>
+#include <mail/mail-session.h>
+#include <e-util/e-config.h>
+#include <libedataserver/e-account.h>
+#include <libedataserver/e-account-list.h>
+
+#include <gtk/gtk.h>
+
+#include <gconf/gconf-client.h>
+
+#include "tracker-evolution-plugin.h"
+#include "tracker-evolution-plugin-glue.h"
+
+#define DIRKEY "/apps/evolution/mail/Tracker"
+#define DIRKEY_LENGTH (G_N_ELEMENTS (DIRKEY) - 1)
+
+static gboolean enabled = TRUE;
+static DBusGProxy *proxy = NULL;
+static GObject *object = NULL;
+
+#define TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_EVOLUTION_PLUGIN, TrackerEvolutionPluginPrivate))
+
+G_DEFINE_TYPE (TrackerEvolutionPlugin, tracker_evolution_plugin, G_TYPE_OBJECT)
+
+/* This runs in-process of evolution (in the mailer, as a EPlugin). It has 
+ * access to the CamelSession using the external variable 'session'. The header
+ * mail/mail-session.h makes this variable public */
+
+#define TRACKER_TYPE_G_STRV_ARRAY   (dbus_g_type_get_collection ("GPtrArray", G_TYPE_STRV))
+
+#ifndef dbus_g_method_get_sender
+gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context);
+#endif
+
+typedef struct {
+	DBusGConnection *connection;
+	GHashTable *registrars;
+	GMutex *mutex;
+} TrackerEvolutionPluginPrivate;
+
+enum {
+	PROP_0,
+	PROP_CONNECTION
+};
+
+
+static void
+tracker_evolution_plugin_finalize (GObject *object)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+
+	g_hash_table_destroy (priv->registrars);
+	g_mutex_free (priv->mutex);
+
+	G_OBJECT_CLASS (tracker_evolution_plugin_parent_class)->finalize (object);
+}
+
+static void 
+tracker_evolution_plugin_set_connection (TrackerEvolutionPlugin *object, DBusGConnection *connection)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+	priv->connection = connection;
+}
+
+
+static void
+tracker_evolution_plugin_set_property (GObject      *object,
+		      guint         prop_id,
+		      const GValue *value,
+		      GParamSpec   *pspec)
+{
+	switch (prop_id) {
+	case PROP_CONNECTION:
+		tracker_evolution_plugin_set_connection (TRACKER_EVOLUTION_PLUGIN (object),
+						 g_value_get_pointer (value));
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+tracker_evolution_plugin_get_property (GObject    *object,
+			      guint       prop_id,
+			      GValue     *value,
+			      GParamSpec *pspec)
+{
+	TrackerEvolutionPluginPrivate *priv;
+
+	priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+
+	switch (prop_id) {
+	case PROP_CONNECTION:
+		g_value_set_pointer (value, priv->connection);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+tracker_evolution_plugin_class_init (TrackerEvolutionPluginClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->finalize = tracker_evolution_plugin_finalize;
+	object_class->set_property = tracker_evolution_plugin_set_property;
+	object_class->get_property = tracker_evolution_plugin_get_property;
+
+	g_object_class_install_property (object_class,
+					 PROP_CONNECTION,
+					 g_param_spec_pointer ("connection",
+							       "DBus connection",
+							       "DBus connection",
+							      G_PARAM_READWRITE |
+							      G_PARAM_CONSTRUCT));
+
+	g_type_class_add_private (object_class, sizeof (TrackerEvolutionPluginPrivate));
+}
+
+static void
+tracker_evolution_plugin_init (TrackerEvolutionPlugin *object)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+
+	priv->mutex = g_mutex_new ();
+	priv->registrars = g_hash_table_new_full (g_str_hash, g_str_equal,
+						  (GDestroyNotify) g_free, 
+						  (GDestroyNotify) g_object_unref);
+}
+
+static int 
+for_message_in_folder_dbus (gpointer data, int ncol, char **colvalues, char **colnames)
+{
+	static int a = 0;
+
+	if (a > 100) {
+		/* Yield per 100 */
+		g_main_context_iteration (NULL, FALSE);
+		a = 0;
+	}
+
+	a++;
+}
+
+static void
+foreach_message_in_folder (CamelFolderInfo *iter, CamelStore *store, CamelDBSelectCB func, gpointer user_data)
+{
+	while (iter) {
+		CamelException ex;
+
+		camel_exception_init (&ex);
+
+		camel_db_read_message_info_records (store->cdb_r, iter->full_name, 
+						    NULL, func, &ex);
+
+		camel_exception_clear (&ex);
+
+		if (iter->child) {
+			foreach_message_in_folder (iter->child, store, func, user_data);
+		}
+
+		/* Yield per folder */
+		g_main_context_iteration (NULL, FALSE);
+
+		iter = iter->next;
+	}
+
+	/* Yield per account */
+	g_main_context_iteration (NULL, FALSE);
+
+}
+
+static void
+foreach_message_in_account (EAccount *account, CamelDBSelectCB func, gpointer user_data)
+{
+	CamelProvider *provider;
+	CamelStore *store;
+	CamelFolderInfo *iter = NULL;
+	CamelException ex;
+	char *uri;
+
+	if (!account->enabled ||!(uri = account->source->url))
+		return;
+
+	camel_exception_init (&ex);
+	if (!(provider = camel_provider_get(uri, &ex))) {
+		camel_exception_clear (&ex);
+		return;
+	}
+
+	if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE))
+		return;
+
+	if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) {
+		camel_exception_clear (&ex);
+		return;
+	}
+
+	iter = camel_store_get_folder_info (store, "", CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_NO_VIRTUAL |
+		CAMEL_STORE_FOLDER_INFO_RECURSIVE, &ex);
+
+	foreach_message_in_folder (iter, store, func, user_data);
+
+	camel_folder_info_free (iter);
+
+	camel_object_unref (store);
+}
+
+
+
+static void
+foreach_message_in_accounts (CamelDBSelectCB func)
+{
+	EAccountList *accounts;
+	GConfClient *gconf;
+
+	gconf = gconf_client_get_default ();
+	accounts = e_account_list_new (gconf);
+
+	if (accounts) {
+		gboolean changed = FALSE;
+		EIterator *it;
+
+		for (it = e_list_get_iterator (E_LIST (accounts)); e_iterator_is_valid (it); e_iterator_next (it)) {
+			EAccount *account = (EAccount *) e_iterator_get (it);
+			foreach_message_in_account (account, func, NULL);
+		}
+
+		g_object_unref (it);
+		g_object_unref (accounts);
+	}
+
+	g_object_unref (gconf);
+
+}
+
+
+static void
+dbus_cb_void_none (DBusGProxy     *proxy,
+		   DBusGProxyCall *call,
+		   gpointer        user_data)
+{
+	GError *error = NULL;
+
+	dbus_g_proxy_end_call (proxy, call, &error,
+			       G_TYPE_INVALID);
+
+	if (error) {
+		g_warning ("%s", error->message);
+		g_error_free (error);
+		return;
+	}
+}
+
+static void
+metadata_set (const gchar *subject, GStrv predicates, GStrv values)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+	GHashTableIter iter;
+	gpointer key, value;
+
+	g_mutex_lock (priv->mutex);
+
+	g_hash_table_iter_init (&iter, priv->registrars);
+
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		DBusGProxy *registrar = value;
+
+		dbus_g_proxy_begin_call (registrar,
+					 "Set",
+					 dbus_cb_void_none,
+					 NULL, 
+					 NULL,
+					 G_TYPE_STRING, subject,
+					 G_TYPE_STRV, predicates,
+					 G_TYPE_STRV, values,
+					 G_TYPE_INVALID);
+	}
+
+	g_mutex_unlock (priv->mutex);
+
+}
+
+
+static void
+metadata_set_many (GStrv subjects, GPtrArray *predicates, GPtrArray *values)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+	GHashTableIter iter;
+	gpointer key, value;
+
+	g_mutex_lock (priv->mutex);
+
+	g_hash_table_iter_init (&iter, priv->registrars);
+
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		DBusGProxy *registrar = value;
+
+		dbus_g_proxy_begin_call (registrar,
+					 "SetMany",
+					 dbus_cb_void_none,
+					 NULL, 
+					 NULL,
+					 G_TYPE_STRV, subjects,
+					 TRACKER_TYPE_G_STRV_ARRAY, predicates,
+					 TRACKER_TYPE_G_STRV_ARRAY, values,
+					 G_TYPE_INVALID);
+	}
+
+	g_mutex_unlock (priv->mutex);
+}
+
+
+static void
+metadata_unset (const gchar *subject)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+	GHashTableIter iter;
+	gpointer key, value;
+
+	g_mutex_lock (priv->mutex);
+
+	g_hash_table_iter_init (&iter, priv->registrars);
+
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		DBusGProxy *registrar = value;
+
+		dbus_g_proxy_begin_call (registrar,
+					 "Unset",
+					 dbus_cb_void_none,
+					 NULL, 
+					 NULL,
+					 G_TYPE_STRING, subject,
+					 G_TYPE_INVALID);
+	}
+
+	g_mutex_unlock (priv->mutex);
+
+}
+
+
+static void
+metadata_unset_many (GStrv subjects)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+	GHashTableIter iter;
+	gpointer key, value;
+
+	g_mutex_lock (priv->mutex);
+
+	g_hash_table_iter_init (&iter, priv->registrars);
+
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		DBusGProxy *registrar = value;
+
+		dbus_g_proxy_begin_call (registrar,
+					 "UnsetMany",
+					 dbus_cb_void_none,
+					 NULL, 
+					 NULL,
+					 G_TYPE_STRV, subjects,
+					 G_TYPE_INVALID);
+	}
+
+	g_mutex_unlock (priv->mutex);
+
+}
+
+
+gboolean
+org_freedesktop_Tracker_check_junk(EPlugin *ep, EMJunkHookTarget *target)
+{
+	CamelMimeMessage *msg = target->m;
+	const char *sub = camel_mime_message_get_subject (msg);
+
+	g_print ("\ncheck?? %s\n", sub);
+
+	return TRUE;
+}
+
+void
+org_freedesktop_Tracker_report_junk (EPlugin *ep, EMJunkHookTarget *target)
+{
+	CamelMimeMessage *msg = target->m;
+	const char *sub = camel_mime_message_get_subject (msg);
+
+	g_print ("\nreport junk?? %s\n", sub);
+}
+
+void
+org_freedesktop_Tracker_non_junk (EPlugin *ep, EMJunkHookTarget *target)
+{
+	CamelMimeMessage *msg = target->m;
+	const char *sub = camel_mime_message_get_subject (msg);
+
+	g_print ("\nreport no junk?? %s\n", sub);
+
+}
+
+void
+org_freedesktop_Tracker_commit_reports (EPlugin *ep)
+{
+}
+
+void *
+org_freedesktop_Tracker_validate_binary (EPlugin *ep)
+{
+	return "1";
+}
+
+
+
+static void
+disable_plugin (void) 
+{
+	if (proxy) {
+		g_object_unref (proxy);
+		proxy = NULL;
+	}
+
+	if (object) {
+		g_object_unref (object);
+		object = NULL;
+	}
+}
+
+static void
+enable_plugin (void)
+{
+	DBusGConnection *connection;
+	GError *error = NULL;
+	guint result;
+
+	if (proxy && object)
+		return;
+
+	if ((proxy && !object) || (!proxy && object))
+		disable_plugin ();
+
+	connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+	if (error)
+		goto error_handler;
+
+	proxy = dbus_g_proxy_new_for_name (connection, 
+					   DBUS_SERVICE_DBUS,
+					   DBUS_PATH_DBUS,
+					   DBUS_INTERFACE_DBUS);
+
+	org_freedesktop_DBus_request_name (proxy, TRACKER_EVOLUTION_MANAGER_SERVICE,
+					   DBUS_NAME_FLAG_DO_NOT_QUEUE,
+					   &result, &error);
+
+	if (error)
+		goto error_handler;
+
+	object = g_object_new (TRACKER_TYPE_EVOLUTION_PLUGIN, 
+			       "connection", connection,
+			       NULL);
+
+	dbus_g_object_type_install_info (G_OBJECT_TYPE (object), 
+					 &dbus_glib_tracker_evolution_plugin_object_info);
+
+	dbus_g_connection_register_g_object (connection, 
+					     TRACKER_EVOLUTION_MANAGER_PATH, 
+					     object);
+
+	error_handler:
+
+	if (error) {
+		g_critical ("Could not setup DBus, %s\n", error->message);
+		g_error_free (error);
+	}
+
+}
+
+static void
+setting_notify (GConfClient *gconf,
+		guint        cnxn_id,
+		GConfEntry  *entry,
+		void        *data)
+{
+	const char *key;
+	GConfValue *value;
+
+	value = gconf_entry_get_value (entry);
+
+	if (value == NULL) {
+		return;
+	}
+
+	key = gconf_entry_get_key (entry);
+	g_return_if_fail (key != NULL);
+
+	g_return_if_fail (!strncmp (key, DIRKEY, DIRKEY_LENGTH));
+	key += DIRKEY_LENGTH;
+
+	g_return_if_fail (*key == '/');
+	++key;
+
+	if (strcmp (key, "enable_support") == 0) {
+		if (gconf_value_get_bool (value))
+			enable_plugin ();
+		else
+			disable_plugin ();
+	}
+}
+
+
+static gboolean 
+do_remove_or_not (gpointer key, gpointer value, gpointer user_data)
+{
+	if (user_data == value)
+		return TRUE;
+	return FALSE;
+}
+
+static void
+service_gone (DBusGProxy *proxy, TrackerEvolutionPlugin *object)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+
+	g_mutex_lock (priv->mutex);
+
+	g_hash_table_foreach_remove (priv->registrars, 
+				     do_remove_or_not,
+				     proxy);
+
+	g_mutex_unlock (priv->mutex);
+}
+
+void 
+tracker_tracker_evolution_plugin_register  (TrackerEvolutionPlugin *object, 
+					    guint64 last_checkout, 
+					    DBusGMethodInvocation *context)
+{
+	TrackerEvolutionPluginPrivate *priv = TRACKER_EVOLUTION_PLUGIN_GET_PRIVATE (object);
+	DBusGProxy *mime_proxy;
+	gchar *sender;
+	gchar *path;
+	guint len;
+	guint i;
+
+	g_mutex_lock (priv->mutex);
+
+	sender = dbus_g_method_get_sender (context);
+	path = g_strdup_printf ("/%s", sender);
+
+	len = strlen (path);
+
+	/* Not sure if this path stuff makes any sense ... but it works */
+
+	for (i = 0; i< len; i++) {
+		if (path[i] == '.')
+			path[i] = '/';
+	}
+
+	mime_proxy = dbus_g_proxy_new_for_name (priv->connection, sender, 
+						path,
+						TRACKER_EVOLUTION_REGISTRAR_INTERFACE);
+
+	g_free (path);
+
+	g_hash_table_replace (priv->registrars, g_strdup (sender), mime_proxy);
+
+	g_signal_connect (mime_proxy, "destroy",
+			  G_CALLBACK (service_gone),
+			  object);
+
+	g_mutex_unlock (priv->mutex);
+
+	dbus_g_method_return (context);
+}
+
+
+int
+e_plugin_lib_enable (EPluginLib *ep, int enable)
+{
+	GConfClient *gconf;
+	guint result;
+
+	if (enable != 1 || enabled == TRUE) {
+		return 0;
+	}
+
+	enabled = TRUE;
+	gconf = gconf_client_get_default();
+
+	gconf_client_add_dir (gconf,
+			      DIRKEY,
+			      GCONF_CLIENT_PRELOAD_ONELEVEL,
+			      NULL);
+
+	gconf_client_notify_add (gconf,
+				 DIRKEY,
+				 setting_notify,
+				 NULL, NULL, NULL);
+
+	enabled = gconf_client_get_bool (gconf,
+		DIRKEY "/enable_support", NULL);
+
+
+	if (enabled)
+		enable_plugin ();
+	else
+		disable_plugin ();
+
+	g_object_unref (gconf);
+
+	return 0;
+}
+
+
+static void
+enable_cb (GtkWidget *widget, gpointer data)
+{
+	gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+	GConfClient *gconf = gconf_client_get_default();
+
+	gconf_client_set_bool (gconf, data, active, NULL);
+
+	g_object_unref (gconf);
+}
+
+
+GtkWidget *
+org_freedesktop_Tracker_use_tracker (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data)
+{
+	GtkWidget *check;
+	guint i = ((GtkTable *)data->parent)->nrows;
+
+	if (data->old)
+		return data->old;
+
+	check = gtk_check_button_new_with_mnemonic (_("Enable Tracker support"));
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), enabled);
+
+	g_signal_connect (GTK_TOGGLE_BUTTON (check), 
+			  "toggled", G_CALLBACK (enable_cb), 
+			  "/apps/evolution/mail/Tracker/enable_support");
+
+	gtk_table_attach((GtkTable *)data->parent, check, 0, 1, i, i+1, 0, 0, 0, 0);
+	gtk_widget_show (check);
+	return (GtkWidget *)check;
+}
+
+
Index: src/tracker-evolution-plugin/tracker-evolution-marshal.list
===================================================================
Index: src/tracker-evolution-plugin/tracker-evolution-registrar.xml
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-registrar.xml	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-registrar.xml	(revision 0)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node name="/">
+  <interface name="org.gnome.evolution.metadata.Registrar">
+
+  <method name="Set">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="s" name="subject" direction="in" />
+      <arg type="as" name="predicates" direction="in" />
+      <arg type="as" name="values" direction="in" />
+    </method>
+
+    <method name="SetMany">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="as" name="subjects" direction="in" />
+      <arg type="aas" name="predicates" direction="in" />
+      <arg type="aas" name="values" direction="in" />
+    </method>
+
+    <method name="Unset">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="s" name="subject" direction="in" />
+    </method>
+
+    <method name="UnsetMany">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+      <arg type="as" name="subjects" direction="in" />
+    </method>
+
+    <method name="Cleanup">
+      <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
+    </method>
+
+  </interface>
+</node>
Index: src/tracker-evolution-plugin/tracker-evolution.c
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution.c	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution.c	(revision 0)
@@ -0,0 +1,37 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+
+#include "tracker-evolution.h"
+#include "tracker-evolution-registrar.h"
+
+void
+tracker_evolution_init (TrackerConfig *config)
+{
+}
+
+void
+tracker_evolution_shutdown ()
+{
+}
Index: src/tracker-evolution-plugin/tracker-evolution-registrar.c
===================================================================
--- src/tracker-evolution-plugin/tracker-evolution-registrar.c	(revision 0)
+++ src/tracker-evolution-plugin/tracker-evolution-registrar.c	(revision 0)
@@ -0,0 +1,144 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Authors:
+ *  Philip Van Hoof <philip@codeminded.be>
+ */
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+
+#include <gconf/gconf-client.h>
+
+#include "tracker-evolution-registrar.h"
+#include "tracker-evolution-registrar-glue.h"
+
+#define TRACKER_EVOLUTION_REGISTRAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_EVOLUTION_REGISTRAR, TrackerEvolutionRegistrarPrivate))
+
+G_DEFINE_TYPE (TrackerEvolutionRegistrar, tracker_evolution_registrar, G_TYPE_OBJECT)
+
+/* This runs in-process of either trackerd or tracker-indexer */
+
+typedef struct {
+	GMutex *mutex;
+} TrackerEvolutionRegistrarPrivate;
+
+enum {
+	PROP_0
+};
+
+
+static void
+tracker_evolution_registrar_finalize (GObject *object)
+{
+	TrackerEvolutionRegistrarPrivate *priv = TRACKER_EVOLUTION_REGISTRAR_GET_PRIVATE (object);
+
+	g_mutex_free (priv->mutex);
+
+	G_OBJECT_CLASS (tracker_evolution_registrar_parent_class)->finalize (object);
+}
+
+
+static void
+tracker_evolution_registrar_set_property (GObject      *object,
+		      guint         prop_id,
+		      const GValue *value,
+		      GParamSpec   *pspec)
+{
+	switch (prop_id) {
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+tracker_evolution_registrar_get_property (GObject    *object,
+			      guint       prop_id,
+			      GValue     *value,
+			      GParamSpec *pspec)
+{
+	TrackerEvolutionRegistrarPrivate *priv;
+
+	priv = TRACKER_EVOLUTION_REGISTRAR_GET_PRIVATE (object);
+
+	switch (prop_id) {
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+	}
+}
+
+static void
+tracker_evolution_registrar_class_init (TrackerEvolutionRegistrarClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+	object_class->finalize = tracker_evolution_registrar_finalize;
+	object_class->set_property = tracker_evolution_registrar_set_property;
+	object_class->get_property = tracker_evolution_registrar_get_property;
+
+	g_type_class_add_private (object_class, sizeof (TrackerEvolutionRegistrarPrivate));
+}
+
+static void
+tracker_evolution_registrar_init (TrackerEvolutionRegistrar *object)
+{
+	TrackerEvolutionRegistrarPrivate *priv = TRACKER_EVOLUTION_REGISTRAR_GET_PRIVATE (object);
+
+	priv->mutex = g_mutex_new ();
+}
+
+
+void
+tracker_evolution_registrar_set (TrackerEvolutionRegistrar *object, 
+				 const gchar *subject, 
+				 const GStrv predicates,
+				 const GStrv values,
+				 DBusGMethodInvocation *context)
+{
+}
+
+void
+tracker_evolution_registrar_set_many (TrackerEvolutionRegistrar *object, 
+				      const GStrv subjects, 
+				      const GPtrArray *predicates,
+				      const GPtrArray *values,
+				      DBusGMethodInvocation *context)
+{
+}
+
+void
+tracker_evolution_registrar_unset_many (TrackerEvolutionRegistrar *object, 
+					const GStrv subjects, 
+					DBusGMethodInvocation *context)
+{
+}
+
+void
+tracker_evolution_registrar_unset (TrackerEvolutionRegistrar *object, 
+				   const gchar *subject, 
+				   DBusGMethodInvocation *context)
+{
+}
+
+void
+tracker_evolution_registrar_cleanup (TrackerEvolutionRegistrar *object, 
+				     DBusGMethodInvocation *context)
+{
+}
Index: configure.ac
===================================================================
--- configure.ac	(revision 2735)
+++ configure.ac	(working copy)
@@ -120,6 +120,8 @@
 LIBGSF_REQUIRED=1.13
 EXEMPI_REQUIRED=1.99.2
 HILDON_THUMBNAIL_REQUIRED=3.0.10
+EVO_REQUIRED=2.25.3
+EDS_REQUIRED=2.25.3
 
 # Library Checks
 PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= $GLIB_REQUIRED])
@@ -181,6 +183,24 @@
   AC_DEFINE(HAVE_RAPTOR, 1, [Raptor RDF parsers])
 fi
 
+# Check for Evolution's plugin system
+PKG_CHECK_MODULES(EVOPLUG, [
+	evolution-plugin >= $EVO_REQUIRED
+	evolution-data-server-1.2 >= $EDS_REQUIRED], 
+	have_evoplug=yes, have_evoplug=no)
+AC_SUBST(EVOPLUG_CFLAGS)
+AC_SUBST(EVOPLUG_LIBS)
+
+if test x$have_evoplug == "xyes"; then
+EVOPLUG_INSTALL_DIR=`$PKG_CONFIG evolution-plugin --variable=plugindir`
+else
+EVOPLUG_INSTALL_DIR=/dev/null
+fi
+
+AC_SUBST(EVOPLUG_INSTALL_DIR)
+
+AM_CONDITIONAL(HAVE_EVOPLUG, test "$have_evoplug" = "yes")
+
 # Check we have the DBUS binding tool we need
 AC_PATH_PROG(DBUSBINDINGTOOL, dbus-binding-tool)
 if test -z $DBUSBINDINGTOOL; then
@@ -1223,6 +1243,7 @@
 	src/tracker-search-tool/Makefile
 	src/tracker-search-tool/tracker-search-tool.desktop.in
 	src/tracker-utils/Makefile
+	src/tracker-evolution-plugin/Makefile
 	tests/common/Makefile
 	tests/libtracker-common/Makefile
 	tests/libtracker-db/Makefile
