[horde] Question for Sieve, Ingo, Horde and maybe saslauthd - not sure
Andy Dorman
adorman at ironicdesign.com
Tue Sep 10 18:10:32 UTC 2013
On 09/10/2013 10:54 AM, Helmut Schiefer wrote:
>
> Dear List,
>
> I try to setup sieve with cyrus-imap and the current, stable horde/ingo
> release. Ubuntu 12.04, Imap 2.4.17 (build from source)
> In case I use Horde without sieve, all runs very well, thanks for
> creating a great solution.
>
> If I enable sieve, I got only a blank login screen and the following
> error in horde.log
>
> 2013-09-09T14:31:44+02:00 ERR: HORDE [imp] Der E-Mail-Server hat einen
> IMAP-Fehler gemeldet. Mailbox does not exist [pid 11316 on line 566 of
> "/internet/horde/imp/lib/Imap.php"]
>
> Is it possible to point me to an idea, what else can I do to find my
> mistake?
>
> Thanks
> Helmut
>
> hooks.php
> =========
> class Ingo_Hooks
> {
> /**
> * 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')
> );
> }
> //
> // DEFAULT: Use hordeauth (identical to not defining hook at
> all).
> // return true;
> }
>
>
> /**
> * Set the default addresses used for the vacation module.
> *
> * @param string $user The username.
> *
> * @return array A list of vacation addresses.
> */
> // public function vacation_addresses($user = null)
> // {
> // // Example #1: User has 2 vacation addresses.
> // return array($user . '@example.com', $user . '@foobar.com');
> // }
>
> }
>
>
> backends.local.php
> ====================
> <?php
> $backends['imap'] = array(
> // ENABLED by default
> // Django : 2013-02-04
> // default: 'disabled' => false,
> 'disabled' => true,
> 'transport' => 'null',
> 'params' => array(),
> 'script' => 'imap',
> 'scriptparams' => array(),
> 'shares' => false
> );
>
> backends['sieve'] = array(
> // Disabled by default
> 'disabled' => false,
> 'hordeauth' => 'full',
> 'transport' => array(
> Ingo::RULE_ALL => array(
> 'driver' => 'timsieved',
> 'params' => array(
> // Hostname of the timsieved server
> 'hostspec' => 'localhost',
> // Login type of the server
> 'logintype' => 'PLAIN',
> // Enable/disable TLS encryption
> 'usetls' => false,
> // Port number of the timsieved server
> 'port' => 2001,
> // Name of the sieve script
> 'scriptname' => 'ingo',
> // Enable debugging. The sieve protocol communication
> is logged
> // with the DEBUG level.
> 'debug' => true,
> ),
> ),
> ),
> 'script' => array(
> Ingo::RULE_ALL => array(
> 'driver' => 'sieve',
> 'params' => array(
> // If using Dovecot or any other Sieve implementation
> that
> // requires folder names to be UTF-8 encoded, set this
> // parameter to true.
> 'utf8' => true,
> ),
> ),
> ),
> 'shares' => false
> );
>
> I test: sieveshell --user=helmut --authname=helmut localhost:2001
> The sieveshell command worked without any problems
>
> Horde Logfile
> ===================
> 2013-09-10T08:25:53+02:00 DEBUG: HORDE [ingo] Load config file
> (conf.php; app: ingo) [pid 7993 on line 409 of "/usr/share/php/Horde.php"]
> 2013-09-10T08:25:53+02:00 DEBUG: HORDE [ingo] Load config file
> (hooks.php; app: ingo) [pid 7993 on line 409 of "/usr/share/php/Horde.php"]
> 2013-09-10T08:26:35+02:00 DEBUG: HORDE [ingo] Load config file
> (backends.php; app: ingo) [pid 8004 on line 409 of
> "/usr/share/php/Horde.php"]
> 2013-09-10T08:26:35+02:00 DEBUG: HORDE [ingo] Hook transport_auth in
> application ingo called. [pid 8004 on line 1141 of
> "/usr/share/php/Horde.php"]
>
Our ingo/backends.local.php set up looks like below. We manage a
cluster of Cyrus servers, so we have to find the specific mailbox server
host name which we save in $hostname and use below.
/* Our Cyrus Sieve backend */
$backends['sieve']['disabled'] = false;
$backends['sieve']['preferred'] = '';
$backends['sieve']['script'][Ingo::RULE_ALL]['driver'] = 'sieve';
$backends['sieve']['script'][Ingo::RULE_ALL]['params']['utf8'] = false;
$backends['sieve']['transport'][Ingo::RULE_ALL]['driver'] = 'timsieved';
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['hostspec'] =
$hostname;
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['logintype'] =
'PLAIN';
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['usetls'] = true;
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['port'] = 4190;
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['scriptname']
= 'ingo';
$backends['sieve']['transport'][Ingo::RULE_ALL]['params']['debug'] = false;
But the above was not enough...we kept getting auth errors. So we also
had to enable the ingo/hooks.php transport_auth function and modify it
as shown below. I commented out the switch in the php code just because
I did not believe it necessary for our purposes. It worked fine with &
without the switch...BUT the euser value is absolutely critical, at
least for Cyrus timesieved.
public function transport_auth($driver)
{
// I am skipping the switch because we are only doing timsieved
// switch ($driver) {
// case 'timsieved':
// return array(
// 'username' => $GLOBALS['registry']->getAuth(null)
// );
//
$ob = $GLOBALS['registry']->call('mail/imapOb');
return array(
'euser' => $ob->getParam('username'),
'password' => $ob->getParam('password'),
'username' => $ob->getParam('username')
);
// }
// DEFAULT: Use hordeauth (identical to not defining hook at all).
// return true;
}
Good luck!
--
Andy Dorman
FanMail.com
Ironic Design, Inc.
AnteSpam.com, HomeFreeMail.com, ComeHome.net
CONFIDENTIALITY NOTICE: This message is for the named person's use only.
It may contain confidential, proprietary or legally privileged
information. No confidentiality or privilege is waived or lost by any
erroneous transmission. If you receive this message in error, please
immediately destroy it and notify the sender. You must not, directly or
indirectly, use, disclose, distribute, or copy any part of this message
if you are not the intended recipient.
More information about the horde
mailing list