October 16, 2020 • 1 min read
Here’s a familiar scenario: you open a new terminal, and before the prompt appears, you see the following.
You have new mail.
What’s going on here?
Events in your operating system can send messages to your mail queue. Although it’s tempting to ignore them because they aren’t colored red or filled with threatening language, you should not ignore these messages. In most cases, your operating system is trying to tell you something important.
Inspect these messages with the
$ mail "/var/mail/jake": 60 messages 60 unread ...
Uh oh, 60 unread messages! Time to get reading. Read each message with
p to print the current message. Go fix what’s wrong, and then
dispose of the message with
Alternatively, you can read this mail file directly. Here’s an example entry:
email@example.com Wed May 20 15:19:20 2020 Return-Path: <firstname.lastname@example.org> X-Original-To: jake Delivered-To: email@example.com Received: by computer.localdomain (Postfix, from userid 501) id 67A83203EC4B55; Sat, 20 Jun 2020 15:19:19 -0400 (EDT) From: firstname.lastname@example.org (Cron Daemon) To: email@example.com Subject: Cron <jake@computer> afplay /System/Library/Sounds/Ping.aiff X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=jake> X-Cron-Env: <USER=jake> Message-Id: <20200520191920.67A83202EC2B53@computer.localdomain> Date: Wed, 20 May 2020 15:19:19 -0400 (EDT) Status: O Error: AudioQueueStart failed (-66681)
Cron portion of
Subject: reveals that this message is from a failing
cron job. All of my messages are the result of problematic cron commands; in
fact that’s a great way to pile up a bunch of automated mail messages. Fix the
commands and clear out the mail.
Did you enjoy this post? Follow me on Twitter for more.