--- horde/imp/lib/Application.php.orig	2016-06-30 14:27:23.880324298 +0200
+++ horde/imp/lib/Application.php	2016-06-30 13:45:49.157182474 +0200
@@ -122,6 +122,10 @@
             $this->auth = array_diff($this->auth, array('add', 'list', 'remove'));
         }
 
+        /* Overwrite Horde_Mail to make sure settings in imp->config->smtp
+         * will be used. */
+        $injector->bindFactory('Horde_Mail', 'IMP_Factory_Mail', 'create');
+
         /* Set exception handler to handle uncaught
          * Horde_Imap_Client_Exceptions. */
         set_exception_handler(array($this, 'exceptionHandler'));