Re: [exim] RHS expansion a la mailertable

Etusivu
Poista viesti
Vastaa
Lähettäjä: Tony Finch
Päiväys:  
Vastaanottaja: exim-users
Kopio: vas
Aihe: Re: [exim] RHS expansion a la mailertable
On Tue, 14 Feb 2006, Philip Hazel wrote:
> On Mon, 13 Feb 2006, vas@??? wrote:
> >
> > In mailertable (sendmail) I can write
> > .old-company.com = smtp:%1.new-company.com
> >
> > In the CGP routing table I can write:
> > *.old-company.com = *.new-company.com
> >
> > How do I achieve the same RHS expansion in an exim router (in route_data)?
>
> What do you actually want to achieve? There are two possibilities:
>
> (1) Rewrite addresses of the form *@*.old-company.com and then route on
> the rewritten address.
>
> (2) Don't rewrite, but route the mail as if addressed to *.new-company.
>
> You can do (1) by adding a rewriting rule, not a router.


We have a facility for doing somthing like this in order to support
long-form names, such as queens.cam.ac.uk instead of the traditional but
excessively abbreviated quns.cam.ac.uk. We use a redirect router to
implement it, as follows below.

Note that we do not rewrite the message header. This is because the person
who used the "wrong" address is the sender, but rewriting the address does
not inform them that they did so, and it hides the fact from the
recipient. This is explained at greater length at
http://www.cus.cam.ac.uk/~fanf2/hermes/doc/misc/longform.txt

# The longshort table contains entries like
#    queens.cam.ac.uk: quns.cam.ac.uk
# to redirect new longer friendly names to old short ugly names.
#
domainlist longshort_domains =    cdb;DB/longshort.cdb


# ...

domain_longshort:
  driver        = redirect
  domains        = +longshort_domains
  data            = ${quote_local_part:$local_part}@${domain_data}
  forbid_blackhole
  forbid_file
  forbid_include
  forbid_pipe
  check_ancestor
  retry_use_local_part


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}