Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70101 - Keep getting a message "You have new mail in /root/" in shell.
Summary: Keep getting a message "You have new mail in /root/" in shell.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 70332 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-11-04 15:15 UTC by Chris Smith
Modified: 2005-02-10 01:00 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
shadow-maildir-check.patch (shadow-maildir-check.patch,1.15 KB, patch)
2004-11-04 16:57 UTC, Gregorio Guidi (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2004-11-04 15:15:34 UTC
"You have new mail in /root/" message keeps appearing in shell after virtually any emerge type activity.

Reproducible: Always
Steps to Reproduce:
1.emerge sync
2.
3.

Actual Results:  
emerge sync worked but them the meesage "You have new mail in /root/" appears.

Expected Results:  
never saw this before and this is no mail in /root/

the forum is pointing the finger at sys-apps/shadow-4.0.5-r2
Comment 1 James Kyte 2004-11-04 15:43:24 UTC
I think the problem lies in files/shadow-4.0.5-login.defs.patch. It looks like the offending line should patch login.defs to read "MAIL_CHECK_ENAB    no", but in the patch file this line is commented. I'm guessing it wasn't in earlier revisions?
Comment 2 Gregorio Guidi (RETIRED) gentoo-dev 2004-11-04 16:55:13 UTC
I don't think files/shadow-4.0.5-login.defs.patch is involved, at runtime
the /bin/su binary uses /etc/login.defs, which is provided by login-pam
and is innocuous.

The problem is probably here. From config.log:

configure:22278: checking location of shared mail directory
configure:22289: result:
configure:22296: checking location of user mail file
configure:22307: result:

and indeed in configure.in there's a check that looks for possible
mail related locations and then... sets empty variables!
So, when invoked as 'su -', su sets a meaningless MAIL variable.

here comes a patch that corrects the issue...
Comment 3 Gregorio Guidi (RETIRED) gentoo-dev 2004-11-04 16:57:07 UTC
Created attachment 43316 [details, diff]
shadow-maildir-check.patch

add 'autoreconf' to src_compile() if you add this to the ebuild.
Comment 4 Toralf Förster gentoo-dev 2004-11-05 12:34:24 UTC
with shadow-4.0.5-r2 and an "su -" from the konsole under kde 3.3.0 I am no longer able to read mail. I got:

nhh221 ~ # mail
/root/: Is a directory

After some investigation I found that the environment variable MAIL is set:

nhh221 ~ # env | grep -i MAIL
MAIL=/root/

This variable should be unset and everything works fine:

nhh221 ~ # unset MAIL
nhh221 ~ # mail
No mail for root

The problem does not appear during login from the command line.
My Question: Why is the MAIL-varibale set ? And where ?
Comment 5 Gregorio Guidi (RETIRED) gentoo-dev 2004-11-06 01:14:41 UTC
> The problem does not appear during login from the command line.
> My Question: Why is the MAIL-varibale set ? And where ?

by su itself (in shadow-4.0.5/libmisc/setupenv.c)
in a default system login comes from pam-login, and is not affected.
Comment 6 Chris Smith 2004-11-07 08:03:35 UTC
Is there not going to be a new ebuild in portage that resolves this problem?
Comment 7 SpanKY gentoo-dev 2004-11-07 21:59:53 UTC
*** Bug 70332 has been marked as a duplicate of this bug. ***
Comment 8 SpanKY gentoo-dev 2004-11-07 22:03:21 UTC
changed MAIL_CHECK_ENAB to default 'no' (removed the comment)

the configure patch was added by az to 4.0.5-r3
Comment 9 Sven Wegener gentoo-dev 2005-02-09 15:35:39 UTC
*** Bug 81421 has been marked as a duplicate of this bug. ***
Comment 10 Brad 2005-02-09 17:47:10 UTC
Umm, this isn't a fix.  The problem will still exist.  Consider the following sequence of commands:

> su -
> mail

/root/ is not a valid inbox format

And no kidding, its a directory.  It makes no sense.  My bet is that su is broken, probably simply compiled with an incorrect option.

Please unresolve, or un-dupe my bug and mark it will not fix, as it is not resolved by the proposed fix.

Thanks!
Comment 11 Martin Schlemmer (RETIRED) gentoo-dev 2005-02-09 22:56:11 UTC
Just update to shadow-4.0.5-r3, I fixed the erronous detection of maildir
there.