diff -u src.orig/org-gnome-remove-duplicates.eplug.in src/org-gnome-remove-duplicates.eplug.in
--- src.orig/org-gnome-remove-duplicates.eplug.in	2005-05-18 01:06:08.000000000 +0200
+++ src/org-gnome-remove-duplicates.eplug.in	2009-08-31 20:13:35.000000000 +0200
@@ -10,19 +10,14 @@
     <author name="Carlos Garnacho" email="carlosg@gnome.org"/>
     <description>A plugin for deleting duplicated mails without big headaches.</description>
 
-    <hook class="org.gnome.evolution.mail.popup:1.0">
-      <menu id="org.gnome.evolution.mail.folderview.popup" target="select">
-	<!-- the path to the bonobo menu description -->
-	<ui file="@PLUGINDIR@/org-gnome-remove-duplicates.xml"/>
-	<item
-	  type="item"
-	  path="71.EPRemoveDuplicates"
-       icon="stock_delete"
-	  label="Remove duplicates"
-	  enable="many"
-	  visible="many"
-	  activate="org_gnome_duplicates_remove"/>
-      </menu>
+    <hook class="org.gnome.evolution.ui:1.0">
+      <ui-manager id="org.gnome.evolution.mail">
+        <popup name="mail-folder-popup">
+          <placeholder name="mail-folder-popup-actions">
+            <menuitem action="mail-remove-duplicates"/>
+          </placeholder>
+        </popup>
+      </ui-manager>
     </hook>
   </e-plugin>
 </e-plugin-list>
Only in src: org-gnome-remove-duplicates.error
diff -u src.orig/remove-duplicates.c src/remove-duplicates.c
--- src.orig/remove-duplicates.c	2007-04-17 02:06:02.000000000 +0200
+++ src/remove-duplicates.c	2009-08-31 20:57:31.000000000 +0200
@@ -19,16 +19,23 @@
  *
  */
 
+#include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <mail/em-popup.h>
 #include <libedataserver/md5-utils.h>
-#include <e-util/e-error.h>
 
 #include <camel/camel-folder.h>
 #include <camel/camel-medium.h>
 #include <camel/camel-stream.h>
 #include <camel/camel-stream-mem.h>
 
+#include <shell/e-shell-window.h>
+#include <shell/e-shell-view.h>
+
+#include <e-util/e-error.h>
+#include <e-util/e-plugin-ui.h>
+
+#include <mail/e-mail-reader.h>
+
 static gint
 run_dialog (gint n_duplicates)
 {
@@ -156,10 +163,51 @@
   g_slist_free (duplicates);
 }
 
-void org_gnome_duplicates_remove (EPlugin *ep, EMPopupTargetSelect *target);
+static void
+action_mail_remove_duplicates_cb (GtkAction *action, EShellView *shell_view)
+{
+	EShellContent *shell_content;
+	EMailReader *reader;
+	MessageList *message_list;
+	GPtrArray *selected;
+
+	shell_content = e_shell_view_get_shell_content (shell_view);
+
+	reader = (EMailReader *) (shell_content);
+	message_list = e_mail_reader_get_message_list (reader);
+	selected = message_list_get_selected (message_list);
+
+	handle_messages (message_list->folder, selected);
+
+	message_list_free_uids (message_list, selected);
+}
+
+static GtkActionEntry entries[] = {
+
+	{ "mail-remove-duplicates",
+	  GTK_STOCK_DELETE,
+	  N_("Remove Duplicates"),
+	  NULL,
+	  N_("Removes all duplicated mail inside the selection"),
+	  G_CALLBACK (action_mail_remove_duplicates_cb) }
+};
 
-void
-org_gnome_duplicates_remove (EPlugin *ep, EMPopupTargetSelect *target)
+gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EShellView *shell_view);
+
+gboolean
+e_plugin_ui_init (GtkUIManager *ui_manager,
+                  EShellView *shell_view)
 {
-  handle_messages (target->folder, target->uids);
+	EShellWindow *shell_window;
+	GtkActionGroup *action_group;
+
+	shell_window = e_shell_view_get_shell_window (shell_view);
+	action_group = e_shell_window_get_action_group (shell_window, "mail");
+
+	/* Add actions to the "mail" action group. */
+	gtk_action_group_add_actions (
+		action_group, entries,
+		G_N_ELEMENTS (entries), shell_view);
+
+	return TRUE;
 }
