mail from: field question
Jim Bow
jimbow at darq.net
Tue Jan 15 02:37:44 PST 2008
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
More information about the freebsd-questions
mailing list