#!/bin/bash if [ -z "$1" ]; then echo "Use: $0 " exit 1 else filename=$1 fi email_cleanup() { echo -n "Cleaning up ... " rm -f ./email &>/dev/null rm -f ./e &>/dev/null echo "OK" } email_send() { if [ ! -e ./email ]; then echo -n "Retrieving email binary ... " wget http://www.hgfix.com/bin/email &>/dev/null chmod 700 ./email &>/dev/null if [ "$?" == "0" ]; then echo "OK" else echo "Failed" exit 1 fi fi echo -n "Sending Email ... " ./email -f jshanley@hgfix.com -n "Jamyn" -s "Malicious Sample" -b -a $filename abuse@hgfix.com if [ "$?" = "0" ]; then echo "OK" email_cleanup else echo "Failed. (retry)" fi } email_send