Re: [Exim] CDB lookup / redirect rule

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Tim Jackson
Fecha:  
A: exim-users
Asunto: Re: [Exim] CDB lookup / redirect rule
In Thu, 22 Jul 2004 13:05:11 +0100 Ken Jackson wrote:

> I recieve the email on the mailhub addressed to
> K.Jackson@??? and want to take the local part (K.Jackson)
> and lookup in the CDB file and deliver the email to
> jacksonk@??? ( a different mailhost server).

[snip]

> with Exim v3, we have a director:
> cdb_lookup:
> driver = aliasfile
> file = /exim/staff.cdb

[snip]

> with Exim v4, is it a router??


Yep.

> cdb_lookup:
> driver = redirect
> allow_fail
> allow_defer
> data = cdb;/exim/staff.cdb


Surely

data = ${lookup{$local_part}cdb{/exim/staff.cdb}}

? Or am I being silly?

> How exactly does it look up the local part of the incoming alias
> (K.Jackson) on the left-hand side of the colon in the CDB file, and
> redirect/deliver it to the full address on the left-hand side of the
> colon?


Well, with what I just suggested, it should be more apparent as you
explicitly use a lookup key ($local_part). What you're essentially doing
is looking up some data from a key/value file (colon-separated in the text
source), so the "final address" is simply the value returned from the
lookup when a lookup with the key $local_part is performed.

Tim