From owner-freebsd-questions@FreeBSD.ORG Fri Jan 4 08:03:50 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91CF816A417 for ; Fri, 4 Jan 2008 08:03:50 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from hermes.hst.org.za (onix.hst.org.za [209.203.2.133]) by mx1.freebsd.org (Postfix) with ESMTP id AA0A113C465 for ; Fri, 4 Jan 2008 08:03:48 +0000 (UTC) (envelope-from jonathan+freebsd-questions@hst.org.za) Received: from sysadmin.hst.org.za (sysadmin.int.dbn.hst.org.za [10.1.1.20]) (authenticated bits=0) by hermes.hst.org.za (8.13.8/8.13.8) with ESMTP id m047wd0s089469 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 4 Jan 2008 09:58:39 +0200 (SAST) (envelope-from jonathan+freebsd-questions@hst.org.za) From: Jonathan McKeown Organization: Health Systems Trust To: FreeBSD Questions Date: Fri, 4 Jan 2008 10:11:18 +0200 User-Agent: KMail/1.7.2 References: <8089C65A-1218-4FCE-8040-16D21296E3DE@optusnet.com.au> <009501c84e10$d147dc50$c5010c0a@SUNYA> <06A8A1F9-B884-4BCF-A0AA-7AE2D4CFCCAC@optusnet.com.au> In-Reply-To: <06A8A1F9-B884-4BCF-A0AA-7AE2D4CFCCAC@optusnet.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801041011.18841.jonathan+freebsd-questions@hst.org.za> X-Spam-Score: -4.339 () ALL_TRUSTED,AWL,BAYES_00 X-Scanned-By: MIMEDefang 2.61 on 209.203.2.133 Subject: Re: Sendmail: sub-domain masquerade as top level X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2008 08:03:50 -0000 On Friday 04 January 2008 01:11, Jerahmy Pocott wrote: > On 04/01/2008, at 12:59 AM, Barry Byrne wrote: > >> -----Original Message----- > >> From: owner-freebsd-questions@freebsd.org > >> [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of > >> Jerahmy Pocott > >> > >> I'm having an issue with getting sendmail to masquerade > >> as the top level domain when the host is a sub domain. > > You don't say what you've tried already. I use postfix these days, > > but from > > memory, something like the following should work for you: > > > > MASQUERADE_AS(`domain.com') > > MASQUERADE_DOMAIN(`sub.domain.com') > > Sorry, I should have mentioned what I had tried: > > I have tried the above and the above in combination with > FEATURE(`masquerade_entire_domain') and pretty much > every combination of those statements all to no effect. > > For some reason when the masquerade domain is the top > level of the actual domain, it won't change it even with those > options set.. This is from my live .mc file, which definitely works: MASQUERADE_AS(`hst.org.za')dnl MASQUERADE_DOMAIN(`hst.org.za')dnl FEATURE(`masquerade_envelope')dnl FEATURE(`masquerade_entire_domain')dnl MASQUERADE_EXCEPTION(`lists.hst.org.za barley.hst.org.za akima.hst.org.za')dnl My understanding is this. First of all, bear in mind that a domain name may refer to a group of hosts (I'll call this a zone by analogy with BIND), or a single host (a FQDN). MASQUERADE_AS gives the FQDN to be used when masquerading. It is applied to the domain names of the local mail host only - so if the only change is on your mailserver to go from mailserver.example.com to example.com, this should be all you need. MASQUERADE_DOMAIN adds additional FQDNs to the list of domain names to be masqueraded - if you need to masquerade other hosts within your zone. FEATURE(`masquerade_entire_domain') switches MASQUERADE_DOMAIN to affect whole zones instead of FQDNs of single hosts. As I read cf/README, you need both these options to masquerade a whole zone, as well as the first option to specify what to masquerade as. The last of the five lines exempts some hosts from masquerading because they handle their own mail. Not doing this can cause some... interesting breakage. Jonathan