Mailfilter documentation
========================

Beginning with Version 2.16 ZeroToaster is able to work with dynamically
loaded mail filters. These filters are usually written by the ZT team for
special customer purposes. We will include some of them into the ZeroToaster
package if we think they are useful for the public.

Installation of custom build filters
====================================
Custom build filters are put into a separate .jar archive. Either place this
file into your classpath or modify the startup line in zerotoaster.cmd/.bat:

java -cp zerotoaster.jar;201_util.jar;dns.jar;CUSTOMFILTER.JAR net.zerotoaster.mta.ZeroToaster

Please stop ZeroToaster::MTA before making any changes to your startup script.

Built-in filters do not need this procedure.

Loading a filter
================
Create a section like the example below somewhere in your zerotoaster.ini

  #-------------------------------------------------------------------------
  # mail filter configuration
  #-------------------------------------------------------------------------
  [MAILFILTERS]
  class=net.zerotoaster.mailfilters.StringFilter

The class names for the various filters are described later.
Do an "internal restart" of ZT to reload zerotoaster.ini

Built-in filters
==========================================================================

Stringfilter
------------
Class  : net.zerotoaster.mailfilters.StringFilter

Purpose: Deletes an incoming mail if a special string occurs somewhere in 
         the mail header or mail body. All incoming and outgoing messages
         are scanned. There is no user selection.

Config : In zerotoaster.ini add a new paragraph

         [MAILFILTER-STRINGFILTER]
         ;redirect=test-account@somedomain.tld
         word=.pif
         word=viagra
         
         Add more "word=" lines for each word to filter. Comparision is
         done case-insensitive internally.
         You can uncomment the "redirect=" line. When active, mails will
         be moved to this account instead of being deleted ("testmode")
[EOT]
