The default behavior is to mail the cronjob output to the user on
whose behalf the cronjob is run. The message
From: header is
constructed as follows:
From: (Cron daemon) <owner@host>
where owner is the login name of the job owner, and host is the name of the host where it was run.
Subject: header contains the owner login name, hostname of the
server where the command was run and the command itself, in the
Cron <user@host> command
A copy of execution environment is included in the message in the form of
X-Cron-Env: headers, each containing a single
The recipient of the message can be altered by setting the
variables in the crontab.
MAILTO variable is the traditional way of defining the
recipients for the job output. It affects all cronjobs in crontab
that appear after it, until next definition of any of the three
variables discussed, or end of the crontab file, whichever occurs
first. It is also reflected in the environment of the job itself.
MAILTO is unset, the default behavior (mailing to the owner)
is restored. If it is set to an empty string, cronjob output is
Notice the difference in the behavior:
Restores default behavior.
MAILTO = ""
Discards the output.
The two built-in variables
MAILTO, with the following differences:
_JOB_MAILTO variable, if set, affects only the cronjob that
immediately follows it. It is not reflected in the environment.
_MICRON_MAILTO variable is rarely used. It works exactly as
MAILTO, except that the actual value of the latter remains
unchanged. It is not reflected in the environment, neither.