    The external Filters Programming Interface (FAPI)
    =================================================
    
        The filters programming interface for AXIGEN is used to implement 
    filters  such  as  anti-virus,  anti-spam  or other mail manipulation 
    software through which, AXIGEN will filter its mail.
      The programming interface is composed of a .h file file: 
    lib_filters.h  to  be  included in the external filter and a library: 
        
    Usage
    =====
        The interface is a virtual class called AxigenFilter which has to 
    be derived and have its process, error, warning and complete callback 
    functions  implemented. Then, a socket has to be created and bound on 
    a  speciffic inet address, and when a connection is made the socket's 
    descriptor  has to be passed to a newly created instance of the class 
    derived from AxigenFilter
    
        WARNING:  Before  the  use of any functions from the AxigenFilter 
    class  or  any  derived ones, this means also the constructor, or any 
    instantiation  method,  a  call to the static function init() MUST be 
    made.  This  call has to be one per process. After the destruction of 
    all  the objects of AxigenFilter or any derived class, and before the 
    process  ends,  a  call to cleanup() MUST be made. After a connection 
    has  been realized and an object created, the read() function must be 
    called.  This  function returns some codes as described below. If the 
    code  returned by the read function is a success code, a write method 
    must be called. Note that before the function read ends, it will call 
    the process function that was implemented in the derived class. After 
    the write function was called, when the writing completes 
    successfuly,  a  call  to  complete()  will  be  made. When the write 
    function exits, if it return a success code, a new read operation can 
    be  made. If any error occurs in the process, the callback error() is 
    called with the error code.
    
      So, to summarize, a call to read is made, the filter reads the mail 
    from  AXIGEN,  if  the  read  is succesful, the process() callback is 
    called  and  if  it returns 0, read() returns success, else a call to 
    error is made. This first step, gets the mail information and the the 
    implementation  must  do  whatever scanning or cleaning in process(). 
    Then,  a  call  to a write function must be made which writes back to 
    AXIGEN.  If  the  writing  process is successfuly, complete() will be 
    called  before  the  write function exits. If complete returns 0, the 
    state of the filter is reset and a new read() can be performed. If it 
    returns  -1, the mail will not be cleanned and a call to clean() must 
    be manually made before the next call to read.
    
    Notes
    =====
        When  reffering to the write function, I am reffering actually to 
    one of the 5 write functions described in the header: 
    writeNeedsCleaning, writeScannedReject, writeScannedOk, 
    writeCleannedReject,  writeCleannedOk.  Only  one  of the 5 functions 
    must  be  called  after a read operation. The read function, after it 
    completes  (without  error) but before it exits will call the process 
    callback.  If  the  process  function  returns  0,  read  will return 
    RT_PROCESSING_COMPLETE which is the success code. The same applies to 
    any  of  the  write  functions,  but  the  callback is complete(). If 
    complete returns 0, the write function will return 
    RT_WRITE_AND_CLEAN_COMPLETE  whic  is  the  success code of any write 
    function. The complete() function is there in the case the 
    implementation  has to cleanup objects before a next call to read the 
    first  process()  is  called  for a mail, it will have the allowclean 
    parameter set to false. This means that, if the implementation has to 
    modify  the  mail,  it must exit process without any modification and 
    call  as  a  write  function, writeNeedsCleaning. Then, when the mail 
    comes  again the process will have allowclean set to true. Beside the 
    messege  to  be passed to axigen, and in some cases several messages, 
    the  write  functions  must  be  called  with  a  parameter  of  type 
    virus_spam  structure  which  contains  2  members:  virusTest,  and  
    spamTest which represent virus and spam level for sieve as defined in 
    the RFC 3685.
    
    Headers
    =======
        All  functions headers and an explanation for each of them can be 
    found in the FAPI-Functions.txt document.
    
    