#!/bin/sh

(

echo "From: mail-abuse-bot <mail-abuse-bot@fsmtpd.7eggert.dyndns.org>"
echo -n 'Date: ';date -R
echo "Content-Type: text/plain; charset=iso-8859-1"
echo "Content-Transfer-Encoding: 8bit"

case "x$1" in
	xIP)
		echo "To: $2"
		cat<<-EOF
Subject: Spam from your IP range

This Message was automatically redirected to you because it was identified to
be spam and to originate from one of your customers. A complete transscript
of the abusive message follows:
EOF
	;;
	xCUST)
		echo "To: $2"
		cat<<-EOF
Subject: Spam from your Customer

This Message was automatically redirected to you because it was identified to
be spam and to originate from one of your customers. A complete transscript
of the abusive message follows:
EOF
	;;
	xHOST)
		echo "To: $2"
		cat<<-EOF
Subject: Spamvertized URL

This Message was automatically redirected to you because it was identified to
be spam and to advertise a URL hosted in your network. A complete transscript
of the abusive message follows:
EOF
	;;
	xRELAY)
		echo "To: $2"
		cat<<-EOF
Subject: Spam relay

This Message was automatically redirected to you because it was identified to
be spam and to be relayed by a host in your network. A complete transscript
of the abusive message follows:
EOF
	;;
	xIFUN)
		echo "To: $2"
		cat<<-EOF
Subject: Spam relay

This Message was automatically redirected to you because it was identified to
be spam and to be probably advertising your service. A complete transscript
of the abusive message follows:
EOF
	;;
	*)
		cat <<-EOF
To: 7eggert@localhost"
Subject: Wrong syntax

Syntax error for abuse.sh: This token is not defined:
EOF
		echo "<$1>"
	;;
esac

echo "$2">>/home/7eggert/Mail/.alog

echo
spamassassin -d

) | /usr/sbin/sendmail -t