From owner-freebsd-questions@FreeBSD.ORG Mon Aug 3 02:01:42 2009 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F5B106566C for ; Mon, 3 Aug 2009 02:01:42 +0000 (UTC) (envelope-from fbsd@dannysplace.net) Received: from mail.dannysplace.net (mail.dannysplace.net [80.69.71.124]) by mx1.freebsd.org (Postfix) with ESMTP id 3DF038FC18 for ; Mon, 3 Aug 2009 02:01:42 +0000 (UTC) (envelope-from fbsd@dannysplace.net) Received: from 203-206-171-212.perm.iinet.net.au ([203.206.171.212] helo=[192.168.10.10]) by mail.dannysplace.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1MXmF1-000PyJ-CX for questions@freebsd.org; Mon, 03 Aug 2009 11:21:33 +1000 Message-ID: <4A763BDD.2010308@dannysplace.net> Date: Mon, 03 Aug 2009 11:22:37 +1000 From: Danny Carroll User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authenticated-User: danny X-Authenticator: plain X-Sender-Verify: SUCCEEDED (sender exists & accepts mail) X-Exim-Version: 4.69 (build at 08-Jul-2008 08:59:40) X-Date: 2009-08-03 11:21:31 X-Connected-IP: 203.206.171.212:3642 X-Message-Linecount: 58 X-Body-Linecount: 47 X-Message-Size: 2081 X-Body-Size: 1703 X-Received-Count: 1 X-Recipient-Count: 1 X-Local-Recipient-Count: 1 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 X-SA-Exim-Connect-IP: 203.206.171.212 X-SA-Exim-Rcpt-To: questions@freebsd.org X-SA-Exim-Mail-From: fbsd@dannysplace.net X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ferrari.dannysplace.net X-Spam-Level: X-Spam-Status: No, score=0.2 required=8.0 tests=ALL_TRUSTED,AWL,TVD_RCVD_IP autolearn=disabled version=3.2.5 X-SA-Exim-Version: 4.2 X-SA-Exim-Scanned: Yes (on mail.dannysplace.net) Cc: Subject: Sendmail Masqurading and root mails X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: fbsd@dannysplace.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2009 02:01:42 -0000 I have a situation that I've come across from time to time that I have never found a good fix for. Sometimes I'll install a freebsd box at a site with private addresses (RFC 1918). Most of the time these sites also have local DNS setups. I'll take my home network as an example. My FreeBSD box (7.2) does: - File serving - PPP/Routing/NATd for the local network - WWW - Local DNS Nothing special. The network is a 192.168 network and the local domain is .lan The problem is when I try to forward periodic output to my real email address. My email box see's the EHLO from beastie.lan and rejects the message based on the fact that root@beastie.lan is an unroutable address. There are a few solutions I've used in the past. - Replace sendmail with exim and configure the SMTP domain. - Put beastie.lan in my email servers hosts file. Neither of these are what I am looking for. I'd like to make sendmail re-write all outgoing emails (envelope as well as message) as *@some.real.domain instead of *@beastie.lan. I have a simple sendmail submit setup. (sendmail=no in rc.conf) I've added the following to the default sendmail mc file: MASQUERADE_AS(`mypublicdomain.com')dnl FEATURE(masquerade_envelope)dnl MASQUERADE_DOMAIN(beasie.lan)dnl Recompiled the cf files and restarted sendmail. Here is the kicker. If I log in as a normal user it masquerades just fine. If I simply "su -" to root, the masquerading works fine and the mail is sent as the original logged in user. But if I log in as root via the console then it does not alter the messages. Apart from ditching sendmail for another MTA, does anyone know how I might coerce sendmail into rewriting root's messages as well?