Re: [EXIM] Filter help

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: James Dehnert
Cc: exim
Asunto: Re: [EXIM] Filter help
On Fri, 23 Oct 1998, James Dehnert wrote:

> can I do something like
>
> message_transport:
> if $domain contains old_company then 
>   if
> ${lookup{${local_part}:new_company}lsearch{/usr/exim/new_company_map}{$value}}
> is company1 then
>     driver = autoreply
>     from = postmaster@xxxx
>     to = $sender_address
>     text = "${local_part}'s address is now ${local_part}@company1"
>     user = mail
>   else
>     driver = autoreply
>     from = postmaster@xxxx
>     to = $sender_address
>     text = "${local_part}'s address is now ${local_part}@company2"
>     user = mail
>   endif
> endif

>
> then have it expand via aliases and deliver the message as usual


No. The string expansion stuff is just that. It expands individual
strings. The configuration itself isn't like a programming language.
However, you could do something like

message_trasnport
  driver = autoreply
  from = postmaster@xxxx
  to = $sender_address
  user = mail
  text = "${local_part}'s address is now ${local_part}@\
    ${lookup{${local_part}:new_company}lsearch{/usr/exim/new_company_map}\
    {$value}}"


> user1=company1
> user2=company2
> user3=company2
> user4=company1


Again no. The format for the lookup you wrote would be

user1 new_company=company1
user2 new_company=company2

However, if you make the lookup key just the local part, without the
"new_company" bit, the format would be

user1 company1
user2 company2

Or, if you wish, that could be made into a NIS or NIS+ map.

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



--
*** Exim information can be found at http://www.exim.org/ ***