From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 13:54:29 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 8B50A106567A for ; Thu, 28 Aug 2008 13:54:29 +0000 (UTC) (envelope-from jon@witchspace.com) Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by mx1.freebsd.org (Postfix) with ESMTP id F38128FC24 for ; Thu, 28 Aug 2008 13:54:28 +0000 (UTC) (envelope-from jon@witchspace.com) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20080828135427.EYXW777.mtaout01-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Thu, 28 Aug 2008 14:54:27 +0100 Received: from witchspace.com ([82.15.251.148]) by aamtaout03-winn.ispmail.ntl.com with SMTP id <20080828135417.EHVD29597.aamtaout03-winn.ispmail.ntl.com@witchspace.com> for ; Thu, 28 Aug 2008 14:54:17 +0100 Received: (qmail 47349 invoked from network); 28 Aug 2008 13:52:21 -0000 Received: from unknown (HELO ?192.168.0.1?) (192.168.0.1) by dookie.home with SMTP; 28 Aug 2008 13:52:21 -0000 Message-ID: <48B6AE4F.3050903@witchspace.com> Date: Thu, 28 Aug 2008 14:55:27 +0100 From: Jonathan Belson User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Matthew Seaman References: <48A00C8C.4060105@witchspace.com> <48A05902.8060103@FreeBSD.org> <48B66D15.5080104@witchspace.com> <48B671B4.9070602@infracaninophile.co.uk> In-Reply-To: <48B671B4.9070602@infracaninophile.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: glarkin@freebsd.org, freebsd-questions@freebsd.org Subject: Re: Changing 'From:' address of periodic scripts 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: Thu, 28 Aug 2008 13:54:29 -0000 Matthew Seaman wrote: > Jonathan Belson wrote: > | | OK, thanks. After playing with MASQUERADE_AS(), MASQUERADE_DOMAIN() > | plus a few FEATURES(), I've managed to change the 'From:' address for > | e-mails sent via the command line. Unfortunately, e-mails sent via > the | cron-ed periodic scripts still don't get through, although if I > run e.g. | 'periodic daily' from the command line, the mail does reach me. > | | The only difference I can think of is that cron runs the scripts as > | root. Could this cause the difference? > > Yes. root is specifically exempted from all the masquerading stuff. > There's an EXPOSED_USER macro you can use in $(hostname).mc to control > that. Ah, that explains it. There doesn't seem to be a way to remove exposed users, but there is a web page explaining how to stop 'root' being added as a default exposed user: http://www.grok.org.uk/docs/smroot.html Instead of doing this, I've told periodic.conf to send its output to my local account on the server, and added a .forward file to pass the e-mail to my 'real' address. Hopefully this will play nicely with sendmail's masquerading. Cheers, --Jon