Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

2 Answers 2

up vote 5 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
add comment

Put unset MAILCHECK in .bashrc.

UPDATE

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
add comment

Your Answer

 
discard

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.