Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jul 2008 12:26:44 -0400
From:      "D W" <lists@duanewinner.net>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   sendmail on server with ip aliases and virtual hosts
Message-ID:  <97351faa0807020926k6419806bhf705f6af12e23888@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

Having a problem with sendmail on some of my servers supporting several
virtual apache hosts. Because these servers have 5-10 ip aliases bound, it
sometimes trips up sendmail when sending outbound mail to my smarthost. All
servers are configured to use the same smarthost. But on one of the hosts,
sendmail will send out as the one of the virtual hosts instead of the main
host, which is what I need.

Example:

webhost01.webdomain.com (10.10.0.1) is the main host.
mail01.webdomain.com (10.10.10.2) is the smarthost.

Five ip aliases for apache virtual servers:
www.siteA.com (10.10.20.1)
www.siteB.com (10.10.20.2)
www.siteC.com (10.10.20.3)
www.siteD.com (10.10.20.4)
www.siteE.com (10.10.20.5)

But when one I try to:
$ telnet mail01.webdomain.com 25

and watch the maillog on the smarthost, it tells me the connection is coming
from www.siteA.com (or one of the other virtual ip aliases/hosts) instead of
the main host, webhost01.webdomian.com.

This will cause "relaying denied" failures on the smarthost, unless I go
into the local-host-names and account for every virtual host and add it.

The other puzzling thing is that I have 9 other "main" hosts with many
virtual hosts, and they all seem to be working the way I expect; ie.,
outbound mail is coming from the main host name/ip instead of one of the
aliases. It's just this webhost01 that is messed up I can't figure out why.
The other thing is that if I destroy an alias, sendmail will use another
aliases, then if I put the destroyed virtual alias back, it may or may not
use it again when sending email.

How do I get sendmail to just send *everything* as from the main host and
connect on the main ip address instead of one of the aliases?

I have in /etc/mail/webhost01.webdomain.com.mc:

OSTYPE(freebsd6)
DOMAIN(generic)
FEATURE(access_db, `hash -o -T<TMPF> /etc/mail/access')
FEATURE(blacklist_recipients)
FEATURE(local_lmtp)
FEATURE(mailertable, `hash -o /etc/mail/mailertable')
FEATURE(virtusertable, `hash -o /etc/mail/virtusertable')
FEATURE(masquerade_envelope)
FEATURE(`genericstable')
GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')
MASQUERADE_AS(`webhost01.webdomain.com')
define(`confDOMAIN_NAME', `webhost01.webdomain.com')
define(`SMART_HOST', `mail01.webdomain.com')

and in generics-domains:
webhost01.webdomain.com


Thanks for any help.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?97351faa0807020926k6419806bhf705f6af12e23888>