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.



Relevant Pages

  • Local/Remote delivery without running daemon
    ... We have the unfortunate policy of not being able to run Sendmail as a daemon, even if it is running only on loopback. ... This is a real problem for output from cron jobs and system emails. ... This worked for mail that was not local, but any mail that was supposed to be delivered locally would be queued up on the relaying server to be delivered back to the server that sent it. ...
  • Re: Cron scripts order of processing - part Two
    ... What happens to the mail when the cron jobs run? ... email based on the cronjobs that ran and was sent to root for review. ... There isn't an install of Sendmail for a default MTA. ...
  • Re: Crontab not sending mail with job output ?
    ... cron jobs don't produce a mail with the script's output, ... I did notice that sendmail was activated at ... mail as alternate for the times I forget to install Mutt. ...
  • Re: Crontab not sending mail with job output ?
    ... openSUS, and the machine boots from an SD, I let someone else do the initial ... install. ... cron jobs don't produce a mail with the script's output, ... And 'service sendmail status' confirms it's running. ...
  • Re: e-mail from cron
    ... In response to David King: ... # Perform daily/weekly/monthly maintenance. ... 2>&1 | sendmail service@xxxxxxxxxxx ... cron jobs, but periodic handles its own output ...