Sendmail wrapper for mailgun

March 1, 2020

If you use the sendmail linux CLI and you want to route outgoing emails through mailgun, write this file, make it executable, and add it to your path before the actual exectuable is found:


# Shim for netdata to send emails through mailgun
# filename: sendmail
# suggested location: /usr/local/bin/

# Installation:
# 1.  Write the contents of this script to a file called "sendmail"
# 2.  Fill in the mailgun smtp email and password from
# 3.  sed -i 's/SENDMAIL_PATH_REPLACE_ME/$(mailgun)/g' sendmail
# 4.  `chmod +x sendmail`
# 5.  `sudo mv -n sendmail /usr/local/bin`


# shellcheck disable=SC2068
    -S \
    -au "$MAILGUN_EMAIL" \
    [email protected]