Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was messing around with sendmail in Rails a year ago and have had this message popping up in the terminal after every command ever since:

You have new mail in /var/mail/Lance

How do I properly get rid of that so the message goes away? I ever use any of that functionality and don't have mail on my computer. There's one file in /var/mail called lance, and it's huge. Can I just remove it?

share|improve this question

migrated from stackoverflow.com Jun 6 '10 at 4:17

This question came from our site for professional and enthusiast programmers.

    
Take a look into the file - it holds mail undelivered to the user - and just remove it if you don't find anything useful there. –  Nikolai N Fetissov Jun 6 '10 at 2:02

3 Answers 3

The old school way is to open a terminal and use

mail

at the prompt, then

d

to delete one message or

d1-4

for for four messages.

Then

q

to quit.

If you don't want to delete them unread, just type Enter at the mail prompt and it'll show each message in turn.

Use

man mail

for all the details.


Of course, other more sophisticated mail clients may be available, but that will do it.

share|improve this answer
7  
Or d * for all messages. –  Nikolai N Fetissov Jun 6 '10 at 2:02
    
how do I make it so it doesn't say "You have new mail" every time I execute a command in the terminal? –  viatropos Jun 6 '10 at 2:31
    
Read or delete every message. If there are more and a few, read some of them so you can figure out what process is sending them and make it stop... –  dmckee Jun 6 '10 at 2:46
    
I checked - I had 210 messages waiting, the latest from January 2006, which is before I bought this computer! The data transfer service was thorough. I used d 1-210 quite successfully. I didn't have anything reminding me, though. –  Jonathan Leffler Jun 6 '10 at 2:47
2  
make sure you type "q" or you deletions will not be saved (i was typing "x" like a moron for 10 mins) –  longda Oct 25 '12 at 17:26

In your ~/.bashrc add:

unset MAILCHECK
share|improve this answer
2  
that won't help in getting rid of the file –  line-o Aug 23 '13 at 22:37
    
~/.bash_profile in Mavericks –  geotheory Jul 1 at 6:56
    
@geotheory The choice between .bashrc and .bash_profile is not specific to the version of the OS. Rather, it concerns login vs non-login shells. See here for more details: joshstaiger.org/archives/2005/07/bash_profile_vs.html –  user72923 Jul 9 at 18:51
    
Thanks for clarifying :) –  geotheory Jul 9 at 20:38

You can just remove the messages from /var/mail/<user>, but you might get more, for example as the result of cron jobs. You can instead have this mail redirected to the normal place you read and store mail on your machine with a .forward file. Simply create a file called .forward in /Users/<username>/ which contains the filename you wish the mail to be stored in.

e.g. in my case, I pull my mail down from my host using IMAP and store it in /Users/ether/mail/i, so I have a file called /Users/ether/.forward which contains the line: /Users/ether/mail/i

share|improve this answer

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.