Cron won't use msmtpd to send emails in case of failed cronjob

Posted by Glister on Server Fault See other posts from Server Fault or by Glister
Published on 2013-11-01T21:54:18Z Indexed on 2013/11/01 21:56 UTC
Read the original article Hit count: 303

Filed under:
|
|
|
|

I'm trying to configure a machine so that it will send me an email if one of the cronjobs output something in case of an error.

  • I'm using Debian Wheezy.
  • Cron is working normally (without the email functionality).
  • msmtp is installed and configured. Have already symlinked /usr/{bin|sbin}/sendmail to /usr/bin/msmtpd.

I can send email by using:

echo "test" | mail -s "subject" [email protected]

or by executing:

echo "test" | /usr/sbin/sendmail

Without the symlink (/usr/sbin/sendmail) cron will tell me that:

(CRON) info (No MTA installed, discarding output)

With the symlinks I get:

(root) MAIL (mailed 1 byte of output; but got status 0x004e, #012)

Can you suggest how to config the cron/msmtp pair?

Thanks!

© Server Fault or respective owner

Related posts about linux

Related posts about debian