Index: /h/imp/lib/Dynamic/Mailbox.php
===================================================================
--- .orig/h/imp/lib/Dynamic/Mailbox.php
+++ /h/imp/lib/Dynamic/Mailbox.php
@@ -104,9 +104,17 @@ class IMP_Dynamic_Mailbox extends IMP_Dy
         }
 
         $sidebar = $injector->getInstance('Horde_View_Sidebar');
-        $sidebar->newLink = $blank->link(array('id' => 'composelink',
-                                               'class' => 'icon'));
-        $sidebar->newText = _("New Message");
+        /* Call disable_compose hook. */
+        $disable_compose = false;
+        try {
+            $disable_compose = $injector->getInstance('Horde_Core_Hooks')->callHook('disable_compose', 'imp');
+        } catch (Horde_Exception_HookNotSet $e) {}
+
+	if (!$disable_compose) {
+            $sidebar->newLink = $blank->link(array('id' => 'composelink',
+                                                   'class' => 'icon'));
+            $sidebar->newText = _("New Message");
+        }
         $sidebar->content = $impSidebar->render('sidebar');
 
         $this->view->sidebar = $sidebar->render();