[clue-tech] postfix relay : connecting to external IP, rather than internal IP

William wlist-clue at kimballstuff.com
Fri Nov 11 22:02:07 MST 2005


Jeffery Cann wrote:
> I have two hosts on my LAN (which is connected via DSL to the
> internet).  I have a single IP address for the DSL box, which points
> to www.example.com.
> 
> jumanji.example.com  192.168.0.4
> www.example.com  192.168.0.5
> 
> www.example.com has a DNS A record and sends/receives email for
> example.com domain.
> 
> I want to forward email sent (via postfix) from jumanji.example.com to
> www.example.com.  So, I put the following in my postfix main.cf for
> jumanji:
> 
> relayhost = www.example.com
> 
> In jumanji's /etc/hosts, I have the following
> 
> 192.168.0.5     www.example.com
> 
> When I try to send email from jumanji, postfix uses the actual
> internet IP (71.33.234.x), rather then the LAN IP (192.168.0.5). 
> Here's an example maillog record:
> 
> Nov 11 21:27:54 localhost postfix/smtp[15285]: 9F866530BB:
> to=<jccann at gmail.com>, relay=none, delay=0, status=deferred (connect
> to www.example.com[71.33.232.x]: Connection refused)
> 
> So, I'm not sure why postfix connects to the external IP, rather than
> the internal IP.
> 
> I'm not sure how to fix this problem.  I'm not even certain this is a
> postfix issue -- it could be my networking configuration.  I
> appreciate any suggestions.

 From the default postfix main.cf file:

# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
#
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.

The implication is that postfix looks for an MX record for the host 
specified with the syntax you are using.  Additionally, any matches in 
the transport table override this setting.

Check for transport matches, then try either:

relayhost = [www.example.com]

or

relayhost = [192.168.0.5]	# Definately a good choice in your case.

-- 
William Kimball, Jr.
http://www.kimballstuff.com/
"Programming is an art-form that fights back!" (Unknown)

_______________________________________________
CLUE-tech mailing list
CLUE-tech at cluedenver.org
http://cluedenver.org/mailman/listinfo/clue-tech



More information about the clue-tech mailing list