*BSD News Article 98318


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!howland.erols.net!newsfeed.internetmci.com!papergirl.highway1.com!chnws02.highway1.com!ndnws01.ne.highway1.com.!news
From: Ted Buswell <tbuswell@balrog.ml.org>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: root's mail???
Date: 23 Jun 1997 22:02:05 -0400
Organization: nntp Needham
Lines: 23
Message-ID: <874taoiwrm.fsf@balrog.ml.org>
References: <5ok7j5$dc5@quail.swcp.com>
NNTP-Posting-Host: tbuswell.ne.highway1.com
To: crs@quail.swcp.com
X-Newsreader: Gnus v5.3/Emacs 19.34
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:43378

crs@quail.swcp.com (Charlie Sorsby) writes:
> 
> What must I do to read root's mail?  I find that I can't do it with
> sudo and I can't do it when I actually su to root--all I get is my
> own mail.  I must have something misconfigured but what?
> 

My guess is that after getting uid=0, you've still got $USER set to
your login name.  By default, 'mail' looks at the file /var/mail/$USER

Try:

	$ su -l root
	# mail

Or:

	$ sudo sh -c "USER=root mail"

A lot (most?) people find it easier to have mail addressed to root end up
in the mailbox of a "real" account (either by .forward or aliases(5)).

-Ted