Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2008 10:37:35 +0000
From:      Jim Bow <jimbow@darq.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: mail from: field question
Message-ID:  <478C8CEF.9090409@darq.net>
In-Reply-To: <Pine.BSF.3.96.1080111135738.10729A-100000@gaia.nimnet.asn.au>
References:  <Pine.BSF.3.96.1080111135738.10729A-100000@gaia.nimnet.asn.au>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?478C8CEF.9090409>