From owner-freebsd-questions@FreeBSD.ORG Wed Jan 9 15:40:55 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 BE9BF16A46B for ; Wed, 9 Jan 2008 15:40:55 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from be-well.ilk.org (dsl092-078-145.bos1.dsl.speakeasy.net [66.92.78.145]) by mx1.freebsd.org (Postfix) with ESMTP id 8BBFE13C447 for ; Wed, 9 Jan 2008 15:40:55 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: by be-well.ilk.org (Postfix, from userid 1147) id C84E02844C; Wed, 9 Jan 2008 10:40:54 -0500 (EST) To: Jim Bow References: <47834FB2.9010907@darq.net> From: Lowell Gilbert Date: Wed, 09 Jan 2008 10:40:54 -0500 In-Reply-To: <47834FB2.9010907@darq.net> (Jim Bow's message of "Tue\, 08 Jan 2008 10\:25\:54 +0000") Message-ID: <443at70zy1.fsf@be-well.ilk.org> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org Subject: Re: mail from: field question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2008 15:40:55 -0000 Jim Bow writes: > I have a small shell script that does a backup to a usb drive and > emails the results to a set of people. The script is triggered from > devd (upon drive attachment) and runs as root. > > The problem is that the mail report is sent from an active system user > and not user root. The user the mail is sent from is not referenced in > the script. The mail line looks like this: > > cat $LOGFILE | mail -s "backuptousb report" recipient@one.net > > I find this rather confusing since I was expecting the email to be > sent by the user running the script. How can this be? > > A little research told me that this may be because of something called > envelope-from, but I found little explanation of what that actually > means. Anyone have any suggestions? The answer will probably depend on the MTA you're using (which you didn't mention, so it's probably sendmail), but checking a couple of simple things first will help ensure you're at least on the right track. Run the script from the command line, and in particular just call mail the way the script does. Make sure the results are the same (if they're not, the MTA isn't the problem). Then, look in the mail logs to see what they tell you about the message.