Re: [EXIM] Planning a mail gateway

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Vadim Vygonets
Data:  
Para: EXIM users list
Assunto: Re: [EXIM] Planning a mail gateway
Quoth Peter Burgess on Fri, Jun 25, 1999:
> I have set up exim with a trivial setup on a couple of boxes to handle
> local mail, but now I am intending to replace sendmail8.8.8 on our
> "gateway" box with Exim 3.02 as looks like an "industrial strength" MTA


Nonononono. You seem to have misunderstood something. Sexchange
is Industrial Strength. Exim is a Good Program. See the
difference?

> with good documentation


Great documentation.

> and support.


The list, yeah. There's no official support, although you can
hire people.

> 1. most mail is addressed to user@??? which goes to
> user@???
> 2. some mail is addressed to user@??? which goes to
> user2@???
> 3. some mail is addressed to user@??? is just relayed
> 4. all mail to external domains is relayed through this box to the
> firewall


You can set up a domainlist router instead of the "lookuphost"
and "literal" routers in the default configuration:

route_mail:
  driver = domainlist
  transport = remote_smtp
  route_list = "my.domain    ${lookup{$local_part}dbm{/var/exim/user2host}{$value.my.domain}{gwmail.my.domain}}    bydns_a; \
        *.my.domain    $domain            bydns_a; \
        *        firewall.my.domain    bydns_a"


Explanation:

First line: I build my databases as dbm files, and therefore
don't ever use lsearch. The file /var/exim/user2host.db (or the
pair of files .dir and .pag, or whatever) should be built from a
file looking like this:

user1:    host1
user2:    host2


where host1 and host2 are the hosts where mail for these users
must be delivered, without the ".my.domain" part (or you can
change the lookup rule). If the user doesn't appear in the
user2host database, mail for this user is sent via SMTP to
gwmail.my.domain.

Second line: if mail is addressed to user@???, it's
sent via SMTP to host.my.domain.

Third line: other mail is sent to the firewall.

By the way, I would rather incorporate this setup into the
installation of exim on the firewall, so it would serve as a
router too. With your scheme, mail is first delivered to the
SMTP firewall, then to the SMTP router (this box), then to the
destination host. A waste, isn't it?

> All mail from internal mail domains is relayed to other hosts or the
> firewall
> 1. most mail is addressed FROM user@??? and is rewritten as
> user@???
> 2. some mail is addressed FROM user@??? and is rewritten as
> user2@???


Read about the Exim re-write rules, and re-write the sender
addresses to hide your hosts. For example,

*@*.my.domain        $1@???        Fh


This re-writes everything except the Envelope To (RCPT) address.
RTFM for more info.

> What is the best configuration to achieve this, at first I was going to
> set local_domains to *my.domain and use an alias list and probably use a
> filter to rewrite the From or Sender etc. to the masqueraded form with a
> "central filter"?


I would set local_domains to an empty string, and do the
following relay configuration:

host_accept_relay = 192.168.0.0/16 : 127.0.0.1
relay_domains = my.domain : *.my.domain

You don't do any local deliveries on this box, do you?

> I need a few hints to get me started!


We all do.

Vadik.

-- 
If you think C++ is not overly complicated, just what is a protected
abstract virtual base pure virtual private destructor, and when
was the last time you needed one?
        -- Tom Cargill, C++ Journal, Fall 1990.


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