Re: [EXIM] Exim as a mail hub

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Philip Hazel
Fecha:  
A: Craig Foster
Cc: exim-users
Asunto: Re: [EXIM] Exim as a mail hub
On Fri, 9 Jan 1998, Craig Foster wrote:

> The set-up I want to achieve is roughly as follows. The mail hub has
> no local users. Mail from off-campus for local-user@mydomain is
> routed to one of several fileservers via SMTP, the destination being
> dependent on the local-part, eg. mail for user1@mydomain is sent to
> user1@???. However, I don't want "host1" appearing in
> the message headers.


Fine. That's a routing problem. Probably easiest to set "mydomain" as
your local domain, and a smartuser director that sends all mail to an
smtp transport that looks up which host to send it to. For example:

# transport

local_user_transport:
driver = smtp
hosts = ${lookup{$local_part}dbm{/some/file}{$value}fail}

# director

local_user_director:
driver = smartuser
transport = local_user_transport

That assumes that /some/file is a DBM file which looks up a local part
and returns a host to send it to. If it were an lsearch file it would
look like

user1: host1.mydomain

but lsearch won't be efficient if you have lots of users. Note that so
far the envelope of the message won't change, so it will be sent on to
host1.domain as "user1@mydomain". If you want to change it, use the
new_address option of the smartuser director. That changes only the
envelope, not the message headers.

> Similarly, mail from user1@??? should
> appear to come from user1@mydomain. To somplicate matters, locally-
> generated mail (where local = campus) to user1@host2 should be routed
> to host2.


That is a rewriting problem. Use the following rewriting rule:

*@*.mydomain $local_part@mydomain fF

the fF rewrites the From header and the envelope From. You might like to
rewrite other things as well.

> PS. Is there a FAQ?


'Fraid noone's got round to making one yet.

Philip

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714



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