31

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?

quack quixote
  • 43,504

3 Answers3

46

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.

Catherine
  • 16,610
21

In your ~/.bashrc add:

unset MAILCHECK
5

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

Ether
  • 1,187