Linux: cron job launches E-Mail but .esmtp_queue gets permission denied

Re: Linux: cron job launches E-Mail but .esmtp_queue gets permission denied

by Leon Stringer -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers

When you run a command using the crontab any output is emailed to the user running the job, in your case apache.

According to the man page for crontab, you can send this to a different user by including a line above the existing entry setting MAILTO to the user you want to receive the email, e.g.

MAILTO=fred
24 */6 * * * apache /var/www/html/moodle-pckurse/admin/cli/cron.php > /dev/null

This would send the email to local user fred instead (assuming the user exists).