If you are using crontab or some other terminal based system applications on Mac OS Big Sur, you may encounter a message saying “You have mail” after opening your Mac OS Terminal application. This is a system message telling you that you have system mail in your systems mail box, NOT, in the Mac Mail GUI application. To read your mail, you can type “mailx”, in your Terminal application. After you are done reading your mail, you may type “q” to quit the system mail application. After this, MacOS will tell you that it is “saving your messages to mbox”.
Once your mac has saved these messages, you can re-access these old messages by typing the following inside your terminal app:
mail -f ~/mbox
Mac OS will then show you all of your saved messages in mbox. It will also give you the number of saved mbox message like “71 messages”, in the top right corner of your terminal.
To delete these messages (all of them), you can issue the following command where “x” is the first message you want to delete, and “y” is the last message you want to delete.
For example, I have 71 saved messages in my mbox. I want to delete all of them. So I would issue the following two commands.
mail -f ~/mbox
… to activate mbox, and…
to delete all of my 71 saved mbox messages.
Once deleted, you can exit out of mbox by typing
q and then hitting “enter”.
There you go. This is just a quick tip on how to delete and manage your Mac OS System mail in mbox.