[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Exim and SMTP on an internet gateway



This one time, at band camp, David Knudsen said:
> On  1 Nov 2002, Mark Lamers wrote:
> > <snip>
> > > It seems easy enough to make exim accept all mail for ourdomain
> > > and forward outgoing mail to the ISP smarthost.  However, local
> > > delivery of mail to ourdomain is not what I need ... I want _that_
> > > mail forwarded 10.0.0.2.
> > > 
> > >
> > $path_iptables -t nat -A PREROUTING -p tcp -d $ext_ip --dport 25 -j
> > DNAT --to $masq_machine_ip:25
> > 
> > will forward all mail to your masked exchangeserv if it listens on
> > on port 
> > 
> > This is firewall based and doens't need an eximserver on your
> > firewall
> 
> Thank you for your very swift reply.
> 
> Actually, I _want_ exim on the firewall to handle the mail forwarding
> ...  later I'll plug anti-virus and anti-spam tools into exim, so
> unwanted mails doesn't reach the exchange server.
The domainlist router seems to be what you're looking for - let me look
it up . . .  http://www.exim.org/exim-html-3.30/doc/html/spec.html and
look for #28.  Note that since 10.0.0.2 will fail MX lookups, you'll
want to specify this route as 10.0.0.2 byname in that section, rather 
than bydns_a.

So it would look something like:
######################################################################
#                      ROUTERS CONFIGURATION                         #
#            Specifies how remote addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#  A remote address is passed to each in turn until it is accepted.  #
######################################################################

# Remote addresses are those with a domain that does not match any item
# in the "local_domains" setting above.

# Send all mail to a smarthost

smarthost:
  driver = domainlist
  transport = remote_smtp
  route_list = ".our_domain.org 10.0.0.2 byname"

smarthost: 
  driver = domainlist
  transport = remote_smtp
  route_list = "* mail.myisp.net bydns_a"

end

Not tested, etc., but this looks to be a starting point for you.

Of course, you'll have to set up rules for what mail is acepted for who
and so forth, as right now you accept all mail for anywhere to anywhere,
and make yourself an open relay.  That's not too hard, though - again
exim.org's FAQ section and documentation is your friend.

HTH,
Steve
-- 
pediddel:
	A car with only one working headlight.
		-- "Sniglets", Rich Hall & Friends

Attachment: pgpUgmsdovJq2.pgp
Description: PGP signature


Reply to: