#!/bin/bash SMA="/usr/sbin/sendmail" grep="grep" #AL="website122503@radparker.com" AL="may2008contact@aliverson.com" #code,name,email,url LIST="al,Al Iverson,$AL,http://www.aliverson.com aq,the AQ Webmaster,$AL,http://www.mnjazz.com wombatlink,Al Iverson,$AL,http://www.wombatlink.com blog,Al Iverson,$AL,http://www.aliverson.com spamr,Al Iverson,$AL,http://www.spamresource.com dnsbl,Al Iverson,$AL,http://www.dnsbl.com coi,Al Iverson,$AL,http://nct.digitalriver.com/fulfill/0010.019 rdt,Al Iverson,$AL,http://www.radparker.com brad,Brad Bellows,bbellows@pconline.com,http://www.mnjazz.com/brad/ don,Don Berryman,don@berryman.com,http://don.berryman.com pat,Pat Cannon,goon@skypoint.com,http://www.skypoint.com/~goon/ laurel,Laurel Krahn,laurel@windowseat.org,http://www.windowseat.org billy,Billy Peterson,planetwillard@gmail.com,http://www.billypeterson.com peter,Peter Schimke,peter@peterschimke.com,http://www.peterschimke.com davis,Davis Wilson,davis@daviswilson.com,http://www.procrasto.org zagozen,Michelle Zagozen,zagozen@hotmail.com,http://www.zagozen.com larry,Larry Lucio,larry@amplifiedlife.com,http://www.amplifiedlife.com phil,Phil Hey,philhey@msn.com,http://www.philhey.com paula,Paula Cisewski,paula@greenfincheditions.com,http://www.greenfincheditions.com brian,Brian McNett,bmcnett@spamresource.com,http://consult.spamresource.com philhey,Phil Hey,philhey@mnjazz.com,http://www.philhey.com philaaron,Phil Aaron,philaaron@mnjazz.com,http://www.philhey.com davehagedorn,Dave Hagedorn,davehagedorn@mnjazz.com,http://www.philhey.com tomlewis,Tom Lewis,tomlewis@mnjazz.com,http://www.philhey.com aldr,Al Iverson,aiverson@digitalriver.com,http://www.digitalriver.com nanabl,NANABL Moderators,moderators@blocklisting.com,http://www.blocklisting.com" cat << EOF Content-type: text/html wombatmail | chicago
wombatmail
EOF eval "`/usr/bin/proccgi $*`" function display_error { ERR=`echo "$1" | sed "s/_/ /g"` cat << EOF
Error: $ERR. EOF #set footer exit 0; } function decode_code { DATA=`echo "$LIST" | grep "^$CODE," | head -1` NAME=`echo "$DATA" | cut -d"," -f2` EMAIL=`echo "$DATA" | cut -d"," -f3 | tr [A-Z] [a-z]` URL=`echo "$DATA" | cut -d"," -f4` WACKY=`echo "$EMAIL" | sed -f /var/www/letterimages.sed` TABLE="
$WACKY
" } function display_navbar { cat << EOF
$NAME's website is at $URL | Back to Previous Page     
EOF } function footer { cat << EOF

Updated May 24, 2008 by Al Iverson.
EOF } function display_form { cat << EOF
EOF if echo "$EMAIL" | $grep -qi "$AL" then cat << EOF
No spam and/or soliciting, please. I do not want to be added to your email list. I do not want to receive your press release. I am not interested in arguing with you about blacklists.
EOF fi cat << EOF
Your name:
Your email address:
To:
$NAME ($WACKY)
Your message:
 
  Note: Your IP address ($REMOTE_ADDR) is being logged.

EOF } if echo "$FORM_Submit" | grep -qi "[a-z]" then : do nothing else if echo "$1" | grep -q "[a-z]" then : do nothing else display_error Dont_know_who_you_want_1 footer exit 0; fi CODE=`echo "$1" | cut -f1| cut -d"," -f1 | cut -d"+" -f1 | cut -c1-20` if echo "$LIST" | grep -q "^$CODE," then : do nothing else display_error Dont_know_who_you_want_2 footer exit 0; fi decode_code display_navbar display_form footer exit 0; fi # #OK, we have post data #FORM_Submit=Send #FORM_TextArea= #FORM_email= #FORM_name= #FORM_recip if echo "$FORM_email" | grep -q "@" then : do nothing else display_error Invalid_email_address_entered footer exit 0; fi if echo "$FORM_name" | grep -q "[A-z]" then : do nothing else display_error You_didnt_enter_your_name footer exit 0; fi if echo "$FORM_TextArea" | grep -q "[A-z]" then : do nothing else display_error You_didnt_enter_any_text footer exit 0; fi CODE="$FORM_recip" if echo "$LIST" | grep -q "^$CODE," then : do nothing else display_error Dont_know_who_you_want_3 footer exit 0; fi decode_code display_navbar #ShoWare #ShoWare web form spammer July 04 if echo "$FORM_TextArea" | grep -qi showare then cat << EOF
Access denied. EOF exit 0; fi # #Does this talk about basketball? if echo "$FORM_TextArea" | grep -qi verticaltraffic then cat << EOF
Vertical Traffic/BlueSecurity spam not accepted. Go away.

Your mail was NOT sent. EOF echo "verticaltraffic match" | mail iverson@mnjazz.com exit 0; fi # #Does this talk about basketball? if echo "$FORM_TextArea" | grep -qi basketball then cat << EOF

Sorry, this is not Allen Iverson of the 76ers. You have the wrong person. Please do not send us email about basketball.

Your mail was NOT sent. EOF exit 0; fi # #Is this an addr.com spam? if echo "$FORM_email" | grep -qi addr\.com then cat << EOF

Sorry, we don't accept advertising from addr.com. Please cease and desist.

Please do not ever contact us ever again for any reason. EOF exit 0; fi dat=`date` SUBJ="Email from $FORM_referer" #WombatForm email from $REMOTE_ADDR" cat << EOF | $SMA "$EMAIL" From: "$FORM_name" <$FORM_email> To: $EMAIL Date: $dat Subject: $SUBJ X-From-URL: $FORM_referrer X-WombatCode: $FORM_code X-User-Agent: "$HTTP_USER_AGENT" X-Source-IP: $REMOTE_ADDR Mail sent from this IP address: $REMOTE_ADDR $FORM_TextArea EOF cat << EOF

Thanks, the following email was sent to $TABLE

From: $FORM_name ($FORM_email)
Date: $dat
Subject: $SUBJ

$FORM_TextArea

Click here to return to $FORM_referer. EOF #echo "

"
#set
footer