OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
relay_domains. Relay one domain only

From: Julian Bond (julian_bondvoidstar.com)
Date: Wed May 03 2006 - 04:26:51 CDT


I'm struggling to find a solution to this.

We have a mail server running postfix which is the main mail for our
domain. We also have a web server running postfix as well that handles
emails generated by the web application. This copy is set to send emails
only. The problem I have is that as both machines are behind a NAT
firewall, when the web app generates an email targeted at our main
domain, it picks up the MX record which has an external IP address.
There's no route out the firewall and then back in again. So for our
domain only I want to relay email to a specific internal IP.

- mail.ourdomain.com: 192.168.0.1, 83.xxx.xxx.xxx
- web.ourdomain.com: 192.168.0.2 email to not_our_domain.com goes
direct. email to ourdomain.com goes to 192.168.0.1 not to
mail.ourdomain.com [83.xxx.xxx.xxx]

One option here is to use /etc/hosts and disable_dns_lookups = yes on
web.ourdomain.com but I'm not happy with this as I'm not convinced that
disable_dns_lookups is using MX records. I suspect that some mail is not
being delivered for people with a different MX record to their A record.

Another option is to use relayhost = 192.168.0.1 and route all mail via
our main mail server. But I'm finding that web is expanding BCC before
relaying it, the main mail server is then being brought to it's knees by
being hit with large numbers of emails in quick succession.

What I should be able to do is to define a hosts file for the internal
DNS used by postfix but I can't see how to do this. I suspect that
there's a way of using relay_domains and relay_transport to only relay
email aimed at ourdomain.com but I can't see it. relay_domains seems to
be aimed at the inverse of this. Relay only to entries and refuse
everything else. I want to relay only one entry and send everything else
direct.

Anyone?

--
Julian Bond E&MSN: julian_bond at voidstar.com M: +44 (0)77 5907 2173
Webmaster: http://www.ecademy.com/ T: +44 (0)192 0412 433
Personal WebLog: http://www.voidstar.com/ skype:julian.bond?chat
                     *** Just Say No To DRM ***