From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 09:16:00 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 BA28A106566B for ; Thu, 28 Aug 2008 09:16:00 +0000 (UTC) (envelope-from jon@witchspace.com) Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by mx1.freebsd.org (Postfix) with ESMTP id 16E818FC17 for ; Thu, 28 Aug 2008 09:15:59 +0000 (UTC) (envelope-from jon@witchspace.com) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20080828091558.NANX21103.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Thu, 28 Aug 2008 10:15:58 +0100 Received: from witchspace.com ([82.15.251.148]) by aamtaout03-winn.ispmail.ntl.com with SMTP id <20080828091558.CBK29597.aamtaout03-winn.ispmail.ntl.com@witchspace.com> for ; Thu, 28 Aug 2008 10:15:58 +0100 Received: (qmail 27504 invoked from network); 28 Aug 2008 09:14:02 -0000 Received: from unknown (HELO ?192.168.0.1?) (192.168.0.1) by dookie.home with SMTP; 28 Aug 2008 09:14:02 -0000 Message-ID: <48B66D15.5080104@witchspace.com> Date: Thu, 28 Aug 2008 10:17:09 +0100 From: Jonathan Belson User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: glarkin@FreeBSD.org References: <48A00C8C.4060105@witchspace.com> <48A05902.8060103@FreeBSD.org> In-Reply-To: <48A05902.8060103@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: 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 09:16:00 -0000 Greg Larkin wrote: > Jonathan Belson wrote: > | Hiya > | > | I set up a remote box to e-mail 'periodic' output to me directly. It > | has now > | stopped working, and I suspect it's because the 'From:' addresses of the > | status > | e-mails is of the form 'root@mybox.local' and the ISP has upped its > | anti-spam > | checks. > | > | I see /usr/sbin/periodic itself uses the 'mail' command to send the > | mails, but I > | couldn't see a command line option to specify a 'From:'. I guess 'mail' > | uses > | 'sendmail' to send e-mail; is there a simple way of forcing a 'From:' > | address > | via 'sendmail' config? > | > Hi Jon, > > Have a look at this: http://www.sendmail.org/m4/masquerading.html and > perhaps this, too: http://www.madboa.com/geek/sendmail-genericstable/ > > You can rewrite root@mybox.local to appear as though it's coming from a > real email address by using the techniques on those pages. > > Please post back here if you run into any trouble! 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? Cheers, --Jon