Well, I'm no master programmer...lol...I wish I could write PHP code the likes of some of the other guys on here...lol What I did was bulky and ugly...but it works.
It's actually quite simple using standard web forms that save the submissions to a plain text file. There were generated in Frontpage but I figured I would post the HTML so you will see what options I set up. These options are required for the text file to be as simple as possible, not included field names, etc.
<form method="POST" action="../_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='../_derived/nortbots.htm';return false;" webbot-onSubmit> <!--webbot bot="SaveResults" u-file="../_private/addfrom.txt" s-format="TEXT/PRE" s-label-fields="FALSE" b-reverse-chronology="FALSE" s-builtin-fields s-form-fields="email " startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" --><p align="center"> <b>White List From Address</b><br> (Please enter one email address per line with no other text)</p> <p align="center">Your request will be automatically processed within 15 minutes.<br> <b>Email Addresses:</b><br> <textarea rows="6" name="email" cols="30"></textarea><br> <br> <br> <input type="submit" value="Submit" name="B1"></p> </form> <p align="center">
<p align="center">
<p align="center">
<form method="POST" action="../_derived/nortbots.htm" webbot-action="--WEBBOT-SELF--" onSubmit="location.href='../_derived/nortbots.htm';return false;" webbot-onSubmit> <!--webbot bot="SaveResults" u-file="../_private/domainfrom.txt" s-format="TEXT/PRE" s-label-fields="FALSE" b-reverse-chronology="FALSE" s-builtin-fields startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="1"><!--webbot bot="SaveResults" endspan i-checksum="43406" --><p align="center"> <b>White List From Domains</b></p> <p align="left">Please enter one domain per line with no other text (i.e. yourdomain.com). Do not white list ISP or free email domains as this can seriously undermine the functionality of the spam filter. This white list is intended for VIP domains that our clients do a lot of business communications with, such as vendors and clients who maintain their own corporate domain names.</p> <p align="center">Your request will be automatically processed within 15 minutes.<br> <b>Domain Name:<br> <textarea rows="5" name="domain" cols="31"></textarea></b></p> <p align="center"><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p> </form>
Here's the batch file that runs every 15 minutes on the server:
@echo off copy addfrom.txt addnew.txt /y copy addfrom.bak addfrom.txt /y type addnew.txt | find "@" >> file://\\unimatrix0\blacklist\exclfrom.txt" CLASS="ASPForums" TITLE="WARNING: URL created by poster. - \\unimatrix0\blacklist\exclfrom.txt copy domainfrom.txt adddomain.txt /y copy domainfrom.bak domainfrom.txt /y type adddomain.txt | find "." >> file://\\unimatrix0\blacklist\excldom" CLASS="ASPForums" TITLE="WARNING: URL created by poster. - \\unimatrix0\blacklist\excldom copy adddomblack.txt addnewdomblk.txt /y copy domblackbak.txt adddomblack.txt /y type addnewdomblk.txt | find "." >> file://\\unimatrix0\blacklist\domains.txt" CLASS="ASPForums" TITLE="WARNING: URL created by poster. - \\unimatrix0\blacklist\domains.txt type addnewdomblk.txt | find "." >> file://\\unimatrix0\blacklist\keywords.txt" CLASS="ASPForums" TITLE="WARNING: URL created by poster. - \\unimatrix0\blacklist\keywords.txt
Note the >> symbol means append output
I have my black/white list folder shared for this script...among other reasons. When someone submits a white list entry for an email address for example, the submission is appended into a text file on the web server called addrom.txt. The batch file is set to run every 15 minutes. It copies the contents of addfrom.txt to a work file called addnew.txt. The *.bak files are simply blank txt files to clear the past appended submissions since the last time the batch file ran. The past submissions are then ran through a find filter that searches for all lines containing the @ symbol which will be valid email addresses. It is stressed to the user that these must be typed in carefully and we only allow admins/office managers access to this form through a secured link that requires authentication.
|