Re: [Exim] substituting $local_part after mysql query

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: Peter Lockhart
Cc: exim-users
Asunto: Re: [Exim] substituting $local_part after mysql query
On Mon, 17 Apr 2000, Peter Lockhart wrote:

> So basically, for my needs, including 'transport = local_delivery' in
> the director is fine so long as the expanded mysql query does not
> contain an "@" (entry 2 above), in which case further expansion must
> happen.


I fear you have misunderstood the way this all works. You really do not
want to set "transport" on an aliasfile, except in very special
circumstances. It is only for the case of using that director to check
an address, not alias it.

Without a transport, aliasing turns one address into another (with or
without an @). Then the new address gets directed or routed from
scratch.

> This will mean all query-results without an "@" will be
> delivered to /var/mail/${local_part} whether they exist as valid system
> users or not.


Precisely. That's why you don't want to set "transport"!!! Let it turn
the result into an address which is then delivered from scratch. Local
users should be picked up by a localuser director.

> This is what I want, just append mail to /var/mail/${local_part} should
> it exist in the mysql table, else expand the address again, and
> optionally send to a router (should the query result in
> user@???)


Ah. I'm now a bit worried. You mean, you really do want to do deliveries
for local parts that aren't local users? In that case I would

(a) Set "no_more" on the aliasfile director, so if it doesn't recognize
the local part, the address is failed.

(b) Still don't set "transport".

(c) Set new_director on the aliasfile so that new addresses in local
domains (generated from results without an @) get passed to the next
director without going through aliasfile again.

(d) Set the next director to be a smartuser that directs to
local_delivery.

(Untested. Off the top of my head.)

> The only solution I can think of is to have two almost identical
> directors, the first with a test condition which says "execute this if
> the mysql query result contains an '@'".


There's no way to do that, afaik.

> mysql_system_aliases:
> condition = ${if match {$value}{@}{yes}}


No good. Condition is tested *before* running the director.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.