<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Spam Filter ISP Forums : Web page to modify SpamFilter.ini and rel</title>
  <link>https://www.logsat.com/spamfilter/forums/</link>
  <description><![CDATA[This is an XML content feed of; Spam Filter ISP Forums : Web Interface Mods : Web page to modify SpamFilter.ini and rel]]></description>
  <pubDate>Sat, 14 Mar 2026 02:06:37 +0000</pubDate>
  <lastBuildDate>Wed, 01 Nov 2006 19:03:11 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.logsat.com/spamfilter/forums/RSS_post_feed.asp?TID=5857</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Spam Filter ISP Forums]]></title>
   <url>https://www.logsat.com/spamfilter/forums/forum_images/web_wiz_forums.png</url>
   <link>https://www.logsat.com/spamfilter/forums/</link>
  </image>
  <item>
   <title><![CDATA[Web page to modify SpamFilter.ini and rel : This is a very simple page for...]]></title>
   <link>https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=5857&amp;PID=9246&amp;title=web-page-to-modify-spamfilterini-and-rel#9246</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.logsat.com/spamfilter/forums/member_profile.asp?PF=19">JeffHildebrand</a><br /><strong>Subject:</strong> 5857<br /><strong>Posted:</strong> 01 November 2006 at 7:03pm<br /><br /><P><strong>This is a very simple page for remote viewing and editing of your SpamFilter.ini and related .txt files.&nbsp; It will create a backup of your current file when you save any changes, it will also show you a history of any changes so you may view any of the old settings and copy them.&nbsp; It is best to run this on an authenticated web site, with appropriate permissions set on the files.</strong></P><P><strong>To Install:<BR>- Copy the <FONT color=#0000cc>asp code</FONT> below and create SpamConfig.asp&nbsp;on your webserver<BR>- Create the directory ..\Spamfilter\OldSettings, for backups and logs in your Spamfilter installation directory<BR>- Modify root paths as desired, default = C:\Program files\Spamfilter...</strong></P><P><strong></strong>&nbsp;</P><P><strong>*code below, copy and paste&nbsp;into - SpamConfig.asp*</strong></P><P><FONT color=#0033cc>&lt;html&gt;<BR>&lt;body&gt;<BR>&lt;%<BR>'&nbsp; USE AT YOUR OWN RISK.&nbsp; THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <BR>'&nbsp; Intended use:<BR>'&nbsp; &nbsp;This asp page is designed to edit SpamFilter.ini and any .txt files located in the SpamFilter directory, it also keeps a running backup and log of any changes made through this page.<BR>' Additional Information:<BR>' &nbsp; Highly recommended to only use this page on a website with authentication enabled, and applicable file security set appropriately to authorized users; i.e. WWWUSER should have not access to your SpamFilter directory.<BR>'&nbsp; &nbsp;Default root paths are hard coded here for additional security, this should only allow .txt files and SpamFilter.ini in that directory to be modified.<BR>'&nbsp; &nbsp;dirbackup is used to keep an archive of any changes made through this asp page (default setting requires the creation of the a folder OldSettings in the Spamfilter installation directory)<BR>' &nbsp; History of any changes is also kept in the dirbackup folder by adding ".log" to the end of the edited file, with links to display the backupfile.</FONT></P><P><FONT color=#0033cc>&nbsp;dirspam="C:\Program Files\SpamFilter\"<BR>&nbsp;dirbackup="C:\Program Files\SpamFilter\OldSettings\"<BR>&nbsp;filespam = "SpamFilter.ini"</FONT></P><P><FONT color=#0033cc>'&nbsp; check if file was carried over from form, if not check parameter sent to asp with ?file=, if still not found use SpamFilter.ini from above<BR>&nbsp;fileedit = request.form("fileedit")<BR>&nbsp;if fileedit="" then<BR>&nbsp;&nbsp;fileedit = request.querystring("file")<BR>&nbsp;end if<BR>&nbsp;if fileedit = "" then<BR>&nbsp;&nbsp;fileedit = filespam<BR>&nbsp;else<BR>&nbsp;&nbsp;if (right(fileedit,4)&lt;&gt;".txt") and (fileedit &lt;&gt; filespam) then<BR>&nbsp;&nbsp;&nbsp;fileedit = fileedit &amp; ".txt"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'allow only .txt and spamfilter.ini edits <BR>&nbsp;&nbsp;end if<BR>&nbsp;end if<BR>&nbsp;set fs=Server.CreateObject("Scripting.FileSystemObject")<BR>&nbsp;<BR>' Check if a showbackup file was request with showbackup=(backupfile)<BR>&nbsp;showbackup=request.querystring("showbackup")<BR>&nbsp;if showbackup&lt;&gt;"" then<BR>&nbsp;&nbsp;if fs.FileExists(dirbackup &amp; showbackup) then<BR>&nbsp;&nbsp;&nbsp;' read backup file<BR>&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirbackup &amp; showbackup,1,&nbsp; False , -2)&nbsp;<BR>&nbsp;&nbsp;&nbsp;bkupContents = FName.ReadAll<BR>&nbsp;&nbsp;&nbsp;FName.Close&nbsp;<BR>&nbsp;&nbsp;end if <BR>&nbsp;end if&nbsp;<BR>&nbsp;if request.form("editing")="true" then<BR>&nbsp;&nbsp;Contents = request.form("Contents")&nbsp;<BR>&nbsp;&nbsp;backupfile = "SFBU-" &amp; year(now()) &amp; right("0" &amp; month(now()),2) &amp; right("0" &amp; day(now()),2) &amp; "-" &amp; right("0"&nbsp; &amp; hour(now()),2) &amp; right("0" &amp; minute(now()),2) &amp; right("0" &amp; second(now()),2) &amp; "-"&amp; fileedit<BR>&nbsp;&nbsp;'backup original file if it exists<BR>&nbsp;&nbsp;if fs.FileExists(dirspam &amp; fileedit) then<BR>&nbsp;&nbsp;&nbsp;' read original file<BR>&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirspam &amp; fileedit,1,&nbsp; False , -2)&nbsp;<BR>&nbsp;&nbsp;&nbsp;bkupContents = FName.ReadAll<BR>&nbsp;&nbsp;&nbsp;FName.Close&nbsp;<BR>&nbsp;&nbsp;&nbsp;' write changes<BR>&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirbackup &amp; backupfile,2,true)<BR>&nbsp;&nbsp;&nbsp;FName.writeline bkupContents<BR>&nbsp;&nbsp;&nbsp;FName.Close<BR>&nbsp;&nbsp;&nbsp;response.write("File Backed up to:" &amp; dirbackup &amp; backupfile &amp; "&lt;br&gt;")<BR>&nbsp;&nbsp;&nbsp;'write out html log of edits<BR>&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirbackup &amp; fileedit &amp; ".log",8,true)<BR>&nbsp;&nbsp;&nbsp;htmlline="&lt;a href=Spamconfig.asp?file=" &amp; fileedit &amp; "&amp;showbackup=" &amp; backupfile &amp; "&gt;" &amp; backupfile &amp;"&lt;/a&gt;&lt;br&gt;" &amp; vbcrlf<BR>&nbsp;&nbsp;&nbsp;FName.writeline htmlLine<BR>&nbsp;&nbsp;&nbsp;FName.Close&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;end if <BR>&nbsp;&nbsp;' write out the changes to the file<BR>&nbsp;&nbsp;set FName=fs.OpenTextFile(dirspam &amp; fileedit,2,true)<BR>&nbsp;&nbsp;FName.writeline Contents<BR>&nbsp;&nbsp;FName.Close<BR>&nbsp;&nbsp;response.write("File Saved:" &amp; dirspam &amp; fileedit)<BR>&nbsp;else<BR>&nbsp;&nbsp;'read file<BR>&nbsp;&nbsp;if fs.FileExists(dirspam &amp; fileedit) then<BR>&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirspam &amp; fileedit,1,&nbsp; False , -2)&nbsp;<BR>&nbsp;&nbsp;&nbsp;Contents = FName.ReadAll<BR>&nbsp;&nbsp;&nbsp;FName.Close<BR>&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;response.write("New File:" &amp; dirspam &amp; fileedit)<BR>&nbsp;&nbsp;end if <BR>&nbsp;end if<BR>%&gt;<BR>&lt;form method="POST" action="SpamConfig.asp"&gt;<BR>&nbsp;&lt;input type=hidden name="editing" value="true"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;input type=hidden name="fileedit" value="&lt;%=fileedit%&gt;"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;table border="0" cellpadding="0" cellspacing="0" width="780"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;tr&gt;&lt;td&gt;&lt;%=fileedit%&gt;&lt;/td&gt;<BR>&lt;%&nbsp;if showbackup&lt;&gt;"" then %&gt;<BR>&nbsp;&lt;td&gt;&nbsp; &lt;%=showbackup%&gt; &lt;/td&gt;<BR>&lt;% end if %&gt;&nbsp; <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&lt;/tr&gt;<BR>&lt;%&nbsp;if showbackup&lt;&gt;"" then %&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;<BR>&nbsp; &nbsp;&nbsp;&lt;textarea rows="44" name="Contents" cols="50"&gt;&lt;%=contents%&gt;&lt;/textarea&gt;<BR>&nbsp; &nbsp;&lt;/td&gt;<BR>&nbsp;&lt;td&gt;&nbsp; <BR>&nbsp;&nbsp;&lt;textarea rows="44" name="Contents" cols="50" readonly="true"&gt;&lt;%=bkupContents%&gt;&lt;/textarea&gt;<BR>&nbsp;&lt;/td&gt;<BR>&nbsp;&lt;/tr&gt;&nbsp;<BR>&lt;% else %&gt;&nbsp;<BR>&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;td&gt;<BR>&nbsp; &nbsp;&nbsp;&lt;textarea rows="44" name="Contents" cols="100"&gt;&lt;%=contents%&gt;&lt;/textarea&gt;<BR>&nbsp; &nbsp;&lt;/td&gt;<BR>&nbsp;&lt;/tr&gt;&nbsp;<BR>&lt;% end if %&gt;&nbsp; <BR>&nbsp;&lt;/table&gt;<BR>&nbsp; &lt;table border="0" cellpadding="0" cellspacing="0" width="380"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;tr&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="278"&gt;&lt;p&gt;&lt;input type="submit" value="Back" name="B1" onclick="javascript:history.back()"&gt; &lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="294"&gt;&lt;p align="center"&gt;&lt;input type="reset" value="Reset" name="B2"&gt;&lt;/p&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td width="275"&gt;&lt;p align="right"&gt;&lt;input type="submit" value="Save" name="B3"&gt;&lt;/p&gt;&lt;/td&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/tr&gt;<BR>&nbsp; &lt;/table&gt;<BR>&lt;/form&gt;<BR>&lt;p&gt;<BR>Related files detected in &lt;a href="SpamConfig.asp"&gt;&lt;%=dirspam &amp; filespam%&gt;&lt;/a&gt;.<BR>&lt;/p&gt;<BR>&lt;ul&gt;<BR>&lt;%<BR>&nbsp;'read default spamfilter.ini settings if needed for linksfile<BR>&nbsp;&nbsp;if fileedit &lt;&gt; filespam then<BR>&nbsp;&nbsp;&nbsp;if fs.FileExists(dirspam &amp; filespam) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirspam &amp; filespam,1,&nbsp; False , -2)&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;Contents = FName.ReadAll<BR>&nbsp;&nbsp;&nbsp;&nbsp;FName.Close<BR>&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;response.write("SpamFilter.ini missing:" &amp; dirspam &amp; fileedit)<BR>&nbsp;&nbsp;&nbsp;&nbsp;response.end<BR>&nbsp;&nbsp;&nbsp;end if <BR>&nbsp;&nbsp;end if</FONT></P><P><FONT color=#0033cc>' parse spamfilter.ini to scan for any filename= and provide links to edit them<BR>&nbsp;strContents = contents <BR>&nbsp;intFN = instr(strContents,"FileName=")<BR>&nbsp;while (intFN&gt;1)<BR>&nbsp;&nbsp;intStart=1<BR>&nbsp;&nbsp;&nbsp;for intI=intFN to 1 step -1<BR>&nbsp;&nbsp;&nbsp;&nbsp;if mid(strContents,intI,2)=vbcrlf then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intStart=intI+2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intI=0<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;next<BR>&nbsp;&nbsp;&nbsp;intEnd = instr(intFN,strContents,vbcrlf)<BR>&nbsp;&nbsp;&nbsp;strDesc = mid(strContents, intStart, intFN - intStart + 9)<BR>&nbsp;&nbsp;&nbsp;strName = mid(strContents,intFN + 9, intEnd -&nbsp; intFN - 9)<BR>&nbsp;&nbsp;&nbsp;strLink = strName<BR>&nbsp;&nbsp;&nbsp;'remove any pathing, to only allow editing in defined spam filter directory <BR>&nbsp;&nbsp;&nbsp;for intI=len(strName) to 1 step -1<BR>&nbsp;&nbsp;&nbsp;&nbsp;if mid(strName,intI,1)="\" then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strLink = mid(strName,intI+1,len(strName)-IntI)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;intI=0<BR>&nbsp;&nbsp;&nbsp;&nbsp;end if<BR>&nbsp;&nbsp;&nbsp;next<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;if strname &lt;&gt;"" then<BR>%&gt;<BR>&nbsp; &nbsp;&lt;li&gt;&nbsp;&lt;%=strDesc%&gt;&lt;a  href="SpamConfig.asp?file=&lt;%=strLink%&gt;"&gt;&lt;%=strNa me%&gt;&lt;/a&gt;&lt;/li&gt;<BR>&lt;%<BR>&nbsp; &nbsp;end  if&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;strContents = mid(strContents,intEnd+1,65000)<BR>&nbsp; &nbsp;intFN = instr(strContents,"FileName=")<BR>&nbsp;wend &nbsp;<BR>&nbsp;<BR>&nbsp;%&gt;<BR>&nbsp;<BR>&nbsp;&lt;/ul&gt;<BR>&nbsp;<BR>&nbsp;<BR>&nbsp;Backup File History<BR>&lt;ul&gt; <BR>&nbsp;&lt;%<BR>&nbsp;<BR>'&nbsp; Read any history log and display it<BR>&nbsp;&nbsp;if fs.FileExists(dirbackup &amp; fileedit &amp; ".log") then<BR>&nbsp;&nbsp;&nbsp;' read log file<BR>&nbsp;&nbsp;&nbsp;set FName=fs.OpenTextFile(dirbackup &amp; fileedit &amp; ".log",1,&nbsp; False , -2)&nbsp;<BR>&nbsp;&nbsp;&nbsp;logContents = FName.ReadAll<BR>&nbsp;&nbsp;&nbsp;FName.Close&nbsp;<BR>&nbsp;&nbsp;&nbsp;response.write(logContents)<BR>&nbsp;&nbsp;end if </FONT></P><P><FONT color=#0033cc>'cleanup file handles <BR>&nbsp;<BR>&nbsp;set FName=nothing<BR>&nbsp;set fs=nothing&nbsp;</FONT></P><P><FONT color=#0033cc>%&gt;</FONT></P><P><FONT color=#0033cc>&lt;/ul&gt;</FONT></P><P><FONT color=#0033cc>&lt;/body&gt;<BR>&lt;/html&gt;</FONT></P><P>&nbsp;</P>]]>
   </description>
   <pubDate>Wed, 01 Nov 2006 19:03:11 +0000</pubDate>
   <guid isPermaLink="true">https://www.logsat.com/spamfilter/forums/forum_posts.asp?TID=5857&amp;PID=9246&amp;title=web-page-to-modify-spamfilterini-and-rel#9246</guid>
  </item> 
 </channel>
</rss>