I want to run a command whenever I have received new unread e-mail. I have an LED connected to my computer which I am able to toggle with a simple command. I want the LED to be on whenever I have unread e-mail in my inbox on that computer.
At first I thought that the task would be simple. But after a lot of googling, I am not able to figure out how to check for new e-mail from cron.
There are several biff applications for X or currently logged in users. None of these seem to be able to run in the background and execute a command when there is a new e-mail.
The simple mail application can check for mail with mail -e giving exit code "0" for mail and "1" for none. But it does not seem to have a similar check for new unread e-mail.
The computer is headless, no X.Org.
Any ideas, anyone?
At first I thought that the task would be simple. But after a lot of googling, I am not able to figure out how to check for new e-mail from cron.
There are several biff applications for X or currently logged in users. None of these seem to be able to run in the background and execute a command when there is a new e-mail.
The simple mail application can check for mail with mail -e giving exit code "0" for mail and "1" for none. But it does not seem to have a similar check for new unread e-mail.
The computer is headless, no X.Org.
Any ideas, anyone?