Re: [EXIM] re-routing mail based on first character of local…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: F. Jacot Guillarmod
Dátum:  
Címzett: Philip Hazel
CC: exim-users
Tárgy: Re: [EXIM] re-routing mail based on first character of local part?
Philip Hazel writes:
>
> On Sat, 31 Jan 1998, F. Jacot Guillarmod wrote:
>
> > according to which campus they are registered on, so I thought the
> > following two directors would handle things:
> >
> > ====================
> > [...]
> >
> > east-london:
> >    driver = smartuser
> >    domain = "campus.ru.ac.za"
> >    prefix = "e9:e0"
> >    new_address = ${local_part}@???

> >
> > grahamstown:
> >    driver = smartuser
> >    domain = "campus.ru.ac.za"
> >    prefix = "g7:g8:g9:g0"
> >    new_address = ${local_part}@???

> >
> > [...]
> > ====================
> >
> > My problem is that it's not clear from the documentation what the effect
> > of "prefix" is. Is that character string, if it exists, stripped from
> > the local_part as used in new_address? If so, is there an obvious method
> > of re-routing according to a component of local_part?
>
> Yes, it is stripped, but it is available in $local_part_prefix. So what
> you need is
>
> new_address = ${local_part_prefix}${local_part}@....
>
> An alternative, or course, is not to use prefix, but instead use
>
> local_parts = ^e[09] and
>
> local_parts = ^g[7890]
>
> respectively.


Not surprisingly, in retrospect, the above didn't work, because the
routing decision has to be made earlier in the delivery cycle than the
stage at which the "directors" component is called up. The "smartuser"
driver is only available for director entries.

But with the above hints from Philip, it was possible to convert this
idea into router entries immediately preceding our MX overrides, as
follows:

===================
eastlondon:
driver = domainlist,
domains = "campus.ru.ac.za",
local_parts = ^e[90],
route_list = "campus.ru.ac.za dolphin.ru.ac.za";

grahamstown:
driver = domainlist,
domains = "campus.ru.ac.za",
local_parts = ^g[7890],
route_list = "campus.ru.ac.za jackal.ru.ac.za";
===================

which exhibit the desired behaviour.

Many thanks,
-- 
F.F. Jacot Guillarmod - Information Technology - Rhodes University - Grahamstown
      Internet: Jacot@???  Phone: +27 461 318284 Fax: +27 461 27764
   The views expressed above are not necessarily those of Rhodes University


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