How to remove the “You have mail.” message in Terminal

Posted on by Elliot Jackson

“You have mail.” started sowing at the top of every new terminal window I opened yesterday. After a bit of googling and no luck with the unset MAILCHECK command I found suggested in most places, StackExchange came to my rescue once again. Here's what worked for me.

The “You have mail.” message showing in the Terminal window

If you type mail in a terminal window, it will show the messages that have — for whatever reason — been sent to your local machine. In my case, the source of them was Cron.

The result of typing mail showing in the Terminal window

To get rid of these messages, as well as the “You have mail.” notification, open Finder and in the menu bar select Go ➜ Go to Folder. In the sheet, type in /var/mail/user where user is the name of the account on your machine you're currently logged into. In my case, /var/mail/Elliot. You should only see one file in there which should be deleted.

The file showing in a Finder window

Once that's done, empty your trash and restart Terminal. The message should be gone.

Showing that the message is no longer in the terminal window

Posted in OS X and Tutorial