Last active
October 11, 2015 19:38
-
-
Save goncha/3909494 to your computer and use it in GitHub Desktop.
forward gzipped error mail to remote address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ | |
# ~/.forward | |
############ | |
"|IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #${USER}" | |
############### | |
# ~/.procmailrc | |
############### | |
:0 Bc | |
* error | |
| ${HOME}/bin/forward | |
############### | |
# ~/bin/forward | |
############### | |
#!/bin/sh | |
FILE=$(mktemp mail.XXXXXXXXXX.txt.gz) | |
gzip >> "${FILE}" | |
mutt -x -s "Error mail from ${LOGNAME}@${HOSTNAME}" -a "${FILE}" -- 'YOUR_MAIL_ADDRESS' | |
rm -f "${FILE}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment