"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
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?
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...
Created attachment 43316 [details, diff] shadow-maildir-check.patch add 'autoreconf' to src_compile() if you add this to the ebuild.
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 ?
> 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.
Is there not going to be a new ebuild in portage that resolves this problem?
*** Bug 70332 has been marked as a duplicate of this bug. ***
changed MAIL_CHECK_ENAB to default 'no' (removed the comment) the configure patch was added by az to 4.0.5-r3
*** Bug 81421 has been marked as a duplicate of this bug. ***
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!
Just update to shadow-4.0.5-r3, I fixed the erronous detection of maildir there.