UPLOAD/RENAME FILTER DLL 
========================

(For use with Serv-U32.exe only!)

This DLL blocks uploading of files with a certain name as well as attempts
to rename a file to one of those names to block. The names that should be 
blocked should be entered in a file named FILTER.INI and placed in the
same directory as the DLL. Wildcards are supported for the names (*,?) 
and it is possible to specify explicit paths or names only. 

To make maintenance easier it is also possible to enter a list of files
that should be allowed. The logic the DLL follows is that any upload/rename
attempt is first verified against the block list. If the file is on this
list the DLL then checks the allow list. If that file is on the allow list
the upload/rename will be allowed. Otherwise it will be blocked. Of course,
if the file was not on the block list in the first place the action will 
always be allowed.

The FILTER.INI file should have the following form (example):

	[BLOCK]
	Filter1=*.txt
	Filter2=\serv-u\serv-u.ini
	Filter3=d:\junk\junk.jpg
	Filter4=f?l??r*.ini

        [ALLOW]
        Path1=c:\tmp\*.txt
        Path2=c:\serv-u\notes.txt

All the names-to-block should follow a section header named '[BLOCK]' and 
start with the term 'Filter' plus a sequential line number. The sample 
above will block uploading/renaming of all files ending with the extension
'txt', files on all drives with the path '\serv-u\serv-u.ini', the 
fully specified path/file with name 'd:\junk\junk.jpg', and I'm sure you'll
figure out the last one by yourself.

All the names-to-allow-even-if-they-are-on-the-block-list should follow a 
section header named '[ALLOW]' and every line should start with the term
'Path' plus a sequential line number. The same above generally blocks all
upload/rename attempts of *.txt files, but it will allow *.txt files in 
c:\tmp and the file c:\serv-u\notes.txt (these would otherwise get blocked
according to the block rules).

The files FILTER.DLL and FILTER.INI should be placed in the Serv-U directory, 
and the SERV-U.INI file should be updated to make it load the DLL upon startup.
This is done by adding a section to the .ini file reading (if it doesn't 
exist already):

	[EXTERNAL]
	EventHookDLL1=FILTER.DLL

If other event hooking DLL's are already present in this section a new 
line like the above one should be added with the proper sequential number.
The files are:

	FILTER.DLL	- 32-bit filter DLL
	FILTER.INI	- sample .ini file for filter DLL
	README.TXT	- this file


SOURCE CODE
===========

The full source code of the filter DLL is provided as an example of an 
event hooking DLL for Serv-U. It can be found in the file SOURCE.ZIP
and was made for Borland C++ v5.01a (But no Borland specific extensions
were used, so it should be easily portable to other platforms). The code
is a mix between C++ and C. This was mostly for convenience of reusing
existing utility code, and while not a pretty picture it works. The core
code that deals with catching events is regular C, so it should be 
possible to use this for similar (event) DLL's in C only. The files are:

	FILTERDLL.CPP	- filter DLL source code
	FILTERDLL.H	- header file for filter DLL
	FILTERDLL.DEF	- module definition file for filter DLL
	FILTERDLL.IDE	- borland project file for filter DLL
	FILTER.LIB	- link library of filter DLL (For testing)
	LIST.H		- linked list C++ class library, used in filter DLL


NOTE
====

As is usual with shareware, and Serv-U in particular: No warranty or support 
is provided with this DLL or the source code. Use is *completely* at your
own risk.
