Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I login to console, e.g tty1, I usually see a message No mail, I know there's some program checking email on login, but I don't use that, how can I disable that command ?

I tried to grep from /etc/profile.* and ~/.bash*, but nothing found

share|improve this question
up vote 7 down vote accepted

This message can also be provided by the pam_mail module, so you can just grep pam_mail * in /etc/pam.d and disable it there.

share|improve this answer

Put unset MAILCHECK in .bashrc.


It seems, the above won't work consistently (although it won't hurt, and to some extent it seems to work). But, check out this section of /etc/pam.d/login - try comment out the last line (or, if it still doesn't work, track this further into the legacy file they mention).

# Prints the status of the user's mailbox upon successful login
# (replaces the MAIL_CHECK_ENAB option from login.defs).
# This also defines the MAIL environment variable. However, userdel
# also needs MAIL_DIR and MAIL_FILE variables in /etc/login.defs to
# make sure that removing a user also removes the user's mail spool
# file. See the comments in /etc/login.defs.
session optional pam_mail.so standard
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.