[ingo] Selecting backends based on current Imp mail server

Jan Schneider jan at horde.org
Tue Mar 30 04:48:03 PST 2004


Zitat von Chris Hastie <lists at oak-wood.co.uk>:

> On Tue, 30 Mar 2004, Jan Schneider <jan at horde.org> wrote:
>
>> Add a mail/getPreferredServer or mail/getCurrentServer method to IMP's api
>> and you're done.
>> All that's left is to add an example how to use that method to the comments
>> of Ingo's backends.php, because you can now do something like:
>>
>> [...]
>> 'preferred' => $GLOBALS['registry']->call('mail/getCurrentServer'),
>> [...]
>>
>> Jan.
>>
>
> You've lost me here. This will, as far as I can see, set the value of
> 'preferred' for a given backend to Imp's current mail server. This 
> will then be
> checked against the current http host name to see if it matches. I don't see
> how this helps.

Ah sure. I confused the mail and the web server.

> On the other hand
>
>     'params' => array(
>         // Hostname of the timsieved server
>         'hostspec' => $GLOBALS['registry']->call('mail/getCurrentServer'),
>         ...
>     ),
>
> might do the trick, at least for multiple Cyrus servers using sieve.

Indeed.

> And taking
> this KISS thing a bit further, wouldn't
>
>      'params' => array(
>           'hostspec' => $GLOBALS[_SESSION]['imp']['server'];
>            ...
>       ),
>
> achieve my aim with out any patching at all?

Sure, but not as a general solution, because IMP might not be available.

> It would not be perfect, as I also have a none Cyrus box that my Imp
> installation points at, which will probably throw some interesting 
> errors if I
> try to use Ingo and a sieve backend for. But only I ever use that 
> server, so I
> can live with it.

Thinking more about it, I guess that hooks for the preferred server in Ingo
as well as in IMP are the cleanest solution. These should hook directly
into the preferred-server-selection-process and would allow the admin to
select the correct server on any criteria he can think of.
Combined with a mail/getCurrentServer api method, the Ingo hook could be a
one-liner then.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - Neue Wege des Lernens
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the ingo mailing list