Skip to content

Instantly share code, notes, and snippets.

@jstangroome
Last active July 13, 2016 07:47
Show Gist options
  • Save jstangroome/3b958f4820d9ffb3f337 to your computer and use it in GitHub Desktop.
Save jstangroome/3b958f4820d9ffb3f337 to your computer and use it in GitHub Desktop.
Mock /usr/sbin/sendmail implementation to see Cron failure detail
#!/bin/bash
# for when a Cron job fails on Ubuntu with "(No MTA installed, discarding output)"
# captures the job output to syslog instead
exec 1> >(/usr/bin/logger --id --tag sendmail-to-syslog --priority mail.notice) 2>&1
echo $ sendmail "$@"
exec cat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment