Wednesday, June 26, 2013

Managesieve, Horde, auth troubles...

I had to mod the create/mod the hooks.php file for ingo.  The key was the euser stuff below, I found no other reference to it anywhere, but it was the soln for me.

    /**
     * Returns the username/password needed to connect to the transport
     * backend.
     *
     * @param string $driver  The driver name (array key from backends.php).
     *
     * @return mixed  If non-array, uses Horde authentication credentials
                      (DEFAULT). Otherwise, an array with the following keys
     *                (non-existent keys will use default values):
     *  - euser: (string; SIEVE ONLY) For the sieve driver, the effective
     *           user to use.
     *  - password: (string) Password.
     *  - username: (string) User name.
     */
    public function transport_auth($driver)
    {
        switch ($driver) {
        case 'timsieved':
//            // Example #1: Use full Horde username for password.
//            return array(
//                'username' => $GLOBALS['registry']->getAuth(null);
//            );
//
//            // Example #2: Use IMP password/username.
            $ob = $GLOBALS['registry']->call('mail/imapOb');
            return array(
                'password' => $ob->getParam('password'),
                'username' => $ob->getParam('username'),
                'euser' => $ob->getParam('username')
            );
        }
//
//        // DEFAULT: Use hordeauth (identical to not defining hook at all).
//        return true;
    }