Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I have setup Cron Jobs to run inside a Chroot Environment, depending on the User/Group;

I have noticed that these cron jobs, running inside the chroot environment, fail to send any mail.

Log files report that it cannot find a program to send mail.

Where does the Cron process look for the default mail binary? Can you set or configure this path?

and on a side note.. if the MAILTO= variable is not set, how does Cron know where to send mail to? does it just send mail to the user running the job, on the local host?


share|improve this question

migrated from Jun 21 '14 at 4:32

This question came from our site for system and network administrators.

1 Answer 1

up vote 4 down vote accepted

Where does the Cron process look for the default mail binary?

Unless otherwise specified I'm fairly sure it just uses the mail program it finds in the path (/bin:/usr/bin). You can though specify the -m command line argument for some versions of cron

-m This option allows you to specify a shell command string to use for sending cron mail output instead of sendmail(8). This com- mand must accept a fully formatted mail message (with headers) on stdin and send it as a mail message to the recipients speci- fied in the mail headers.

The above works on CentOS/RHEL, Ubuntu looks different

Can you set or configure this path?

See above.

if the MAILTO= variable is not set...

If MAILTO is not set then as you suspect the mail is delivered to the local user who is running the job.

On CentOS/RHEL you can specify extra command line arguments in /etc/sysconfig/crond so that you dont't have to edit your init scripts. Other OS/distros may provide similar functionality.

share|improve this answer
thank you for clarifying this for me! – RapidWebs Jun 19 '14 at 18:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.