Skip to content

Instantly share code, notes, and snippets.

@fapestniegd
Created November 10, 2010 19:23
Show Gist options
  • Save fapestniegd/671355 to your computer and use it in GitHub Desktop.
Save fapestniegd/671355 to your computer and use it in GitHub Desktop.
:0 c
* ^Received: .*for <nagios.mail.check*
| /usr/bin/formail -c -XFrom: -XReceived: | perl -e 'while(<STDIN>){ if(m/From:\s+(.*)/){ $from=$1; }if(m/Received:.*for <nagios.mail.check@(.*)>/){ $to=$1; } } print "$to\t$to mail routing\tOK\tmail received from $from\n";' | /usr/sbin/send_nsca -H 127.0.0.1 -c /etc/send_nsca.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment