[ale] You've got mail.

Mark Shewmaker mark at primefactor.com
Fri Jul 14 14:21:22 EDT 2000


On Fri, Jul 14, 2000 at 09:13:11AM -0400, Terzo wrote:
> 
> What i think is wrong.
> 
> either your .bashrc or your .bash_profile doesn't meet the new impoved way
> of checking to see if you have mail..  You said this happened after you
> upgraded.. The usesers that don't get this message were they actually
> created after or before the upgade.

Nope, that wasn't it.

But, I have figured out what it was.

The problem showed up more than with just the bash shell--I changed
my shell to tcsh and still had the problem:  I would log out and
log in, and get the "You have new mail." message (printed even before
/etc/profile starts running.)

It turns out that the message was from /bin/login.

>From login.c:

    if (!quietlog) {
        struct stat st;
        char *mail;

        motd();
        mail = getenv("MAIL");
        if (mail && stat(mail, &st) == 0 && st.st_size != 0
                 && st.st_size != REDHAT_IGNORED_MAILSIZE) {
                printf(_("You have %smail.\n"),
                       (st.st_mtime > st.st_atime) ? _("new ") : "");
        }
    }

If you look at the last line, you can see that it's only adding "new "
if the mail file hasn't been accessed since it's been written.

Or another way of saying that--if the mail file is never accessed, but
only written to, you'll always be told you have new mail.

Well, I had the filesystem containing /var/spool/mail mounted with "noatime".

Remounting that filesystem it with "defaults" solved the problem.

(I don't know why some users never saw the problem.  Maybe they're
using procmail far more extensively than I am.)

 -Mark Shewmaker
  mark at primefactor.com
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list