How to get rid of "You have new mail." in zsh
I'm using zsh with prezto as my shell with iTerm as terminal app.
I always get the message "You have new mail" when opening a new prompt. I don't have any new mail in Mac Mail and I don't run a mail server.
How can I get rid of this message?
Thanks
It tells you that you have received some mails (for example, because of your configuration of cron).
The best way is to read this mail. Type mail
: at least one mail should appear. You can read by typing its number ID. You can also directly delete it (or even multiple mails) by typing d 1-1344
(1-1344
being the range of your new mails' IDs). Leave mail
with x
.
Whether zsh
checks for new mail can be adjusted through the MAILCHECK
parameter as described in zshparam(1). It specifies the interval in seconds between checks for new mail, a zero turns off the checks completely. So just put this into your zsh
configuration file:
# don't check for new mail
MAILCHECK=0
So apparently some program (probably my MAMP) put an email in
/var/mail/
Deleting this message did the trick...
In case you want to check what those mails actually are before ignoring them, you can read the mails by:
mail
and read one the emails by entering a number, e.g.:
1
and if you have fixed the problem reported by the mails (in my case, the cron
jobs are failing due to renaming a folder) and feel comfortable to delete all the mails:
delete *
then quit the program:
q
as shown in following screenshot: