Created
February 6, 2014 11:37
-
-
Save Caffe1neAdd1ct/8842544 to your computer and use it in GitHub Desktop.
Stop live emails going out via sendmail
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
#!/bin/bash | |
formail -R cc X-original-cc \ | |
-R to X-original-to \ | |
-R bcc X-original-bcc \ | |
-f -A"To: [email protected]" \ | |
| /usr/sbin/sendmail -t -i | |
# pipe all to a log instead, comment out formail code | |
#tee -a /tmp/trapmail.log > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
formail command is provided by the
procmail
package on CentOS 6