Re: Preventing >empty< cron email messages...

On Jan 29, 1:50 pm, "Nedron" <use...@xxxxxxxxxx> wrote:
Is there a known mechanism for preventing empty email messages being
sent by cron jobs?

Basically, we have several cron jobs that always generate a message on
every run. The messages may or may not have content in the body. We
want messages with content to be sent, but empty messages to be /dev/

Obviously, the usual "> /dev/null 2>&1" style or MAILTO directives
won't work, since we actually do want some messages to make it out of
the box for this job, but not the empty ones.

Any ideas? Should I be looking at sendmail for this?

I'm not certain that sendmail would be a good idea. It probably could
handle the filtering, but sendmail configuration is an arcane art, and
this sort of filter might take a sendmail wizard to build.

You /should/ be able to do this fairly easily with a procmail recipe,
if you have procmail installed.