From owner-freebsd-questions@FreeBSD.ORG Tue Jan 15 10:37:44 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 A493E16A419 for ; Tue, 15 Jan 2008 10:37:44 +0000 (UTC) (envelope-from jimbow@darq.net) Received: from farnborough.darq.net (fab.darq.net [82.136.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id 74A5513C458 for ; Tue, 15 Jan 2008 10:37:44 +0000 (UTC) (envelope-from jimbow@darq.net) Received: from localhost (localhost [127.0.0.1]) by farnborough.darq.net (Postfix) with ESMTP id DB9A21D0DF for ; Tue, 15 Jan 2008 10:38:03 +0000 (GMT) X-Virus-Scanned: amavisd-new at darq.net Received: from farnborough.darq.net ([127.0.0.1]) by localhost (farnborough.darq.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8x+iR8sbjnnH for ; Tue, 15 Jan 2008 10:37:57 +0000 (GMT) Received: from troop.darq.net (hackney.darq.net [78.86.112.102]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zygis@darq.net) by farnborough.darq.net (Postfix) with ESMTP id 952F91D0E5 for ; Tue, 15 Jan 2008 10:37:57 +0000 (GMT) Message-ID: <478C8CEF.9090409@darq.net> Date: Tue, 15 Jan 2008 10:37:35 +0000 From: Jim Bow User-Agent: Thunderbird 2.0.0.6 (X11/20071004) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: mail from: field question 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: Tue, 15 Jan 2008 10:37:44 -0000 Ian Smith wrote: > paqi# alias um > tty;id -p;who am i > paqi# um > /dev/ttyp3 > login smithi > uid root > groups wheel operator network > root ttyp3 Jan 11 14:09 > > Note 'id -p' showing 'login smithi'; see id(1) .. I gather that sendmail > must also use getlogin(2) - which value does not appear in `env` - when > sending mail from an su'd session, as opposed to an original root login, Yes, I think you've hit the nail on the head there. > > The actual thing Im trying to do is to email something from a script > > that runs as root from devd, but I run into the same problem of the > > email arriving from somebody other than root, hence trying this manually > > on the command line. > > Is 'somebody other than root' consistent, and someone who's logged in, > perhaps before su'ing and then starting the session that invokes devd? 'somebody other than root' is the same user each time. They are not logged in at the time the script runs, but do own some active processes (most notably screen). > > There is definitely something that I am overlooking, but what is it? I'm > > extremely curious to work-out why I'm seeing such behavior as its > > defeating all my expectations so far. > I noticed later that Paul gets a different result .. maybe postfix as > mentioned Postfix doesn't seem to be affected by the same issue and works as one would expect when run from command line and devd. I've also tried using nullmailer and that works ok too. Seems that sendmail's workings were responsible for the confusion. I'm going to be replacing it with nullmailer on all machines. Thanks for all your help, Jim Bow