From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 09:37:14 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 33D21106566B; Thu, 28 Aug 2008 09:37:14 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B2AD68FC0A; Thu, 28 Aug 2008 09:37:13 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from lack-of-gravitas.thebunker.net (gateway.ash.thebunker.net [213.129.64.4]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.2/8.14.2) with ESMTP id m7S9aq7R043235 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Aug 2008 10:37:02 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.7.0 smtp.infracaninophile.co.uk m7S9aq7R043235 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1219916222; bh=KES0QMSIeOyrlv DqaGy3syt3X5UgtuPUzy0oO23QgmE=; h=Message-ID:Date:From:MIME-Version: To:CC:Subject:References:In-Reply-To:Content-Type: Content-Transfer-Encoding:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<48B671B4.9 070602@infracaninophile.co.uk>|Date:=20Thu,=2028=20Aug=202008=2010: 36:52=20+0100|From:=20Matthew=20Seaman=20|Organization:=20Infracaninophile|User-Agent:=20Thunderbird= 202.0.0.16=20(X11/20080811)|MIME-Version:=201.0|To:=20Jonathan=20Be lson=20|CC:=20glarkin@freebsd.org,=20freebsd-qu estions@freebsd.org|Subject:=20Re:=20Changing=20'From:'=20address=2 0of=20periodic=20scripts|References:=20<48A00C8C.4060105@witchspace .com>=20<48A05902.8060103@FreeBSD.org>=20<48B66D15.5080104@witchspa ce.com>|In-Reply-To:=20<48B66D15.5080104@witchspace.com>|X-Enigmail -Version:=200.95.6|Content-Type:=20text/plain=3B=20charset=3DUTF-8= 3B=20format=3Dflowed|Content-Transfer-Encoding:=207bit; b=AKgCeo8mA o6erNIgdJCPeW3kBepG0xEqKqRc5YP55Tfu5LbEJyWexqd6H6trgeH/UuGtn7KHDJml is/NUCOzFYtHP6blBqu6OArh8otyUKj1BvKngqxruMkYyzSlRt/Z9rbxw74J9Qq/WaK MztDgOaAIqTSoYORyatLQcfI4OnA= Message-ID: <48B671B4.9070602@infracaninophile.co.uk> Date: Thu, 28 Aug 2008 10:36:52 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.16 (X11/20080811) MIME-Version: 1.0 To: Jonathan Belson References: <48A00C8C.4060105@witchspace.com> <48A05902.8060103@FreeBSD.org> <48B66D15.5080104@witchspace.com> In-Reply-To: <48B66D15.5080104@witchspace.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.93.3/8104/Thu Aug 28 03:11:35 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,SPF_FAIL autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk 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 09:37:14 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: RIPEMD160 Jonathan Belson wrote: | 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? 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. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. Flat 3 ~ 7 Priory Courtyard PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate ~ Kent, CT11 9PW, UK -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREDAAYFAki2cbQACgkQ3jDkPpsZ+VbRXgCcDzrkWTG0YsLNESOGA3H0Wof9 zk8AoJmW4bdOUC07pQ10nqw+ZluKLXtn =KZr6 -----END PGP SIGNATURE-----