Filters, which are used to reject spam and for similar
reasons, are explained in the Weasel manual WEASEL.INF

There are no filters in this distribution.  You can
download some filters from
     http://pmoylan.org/pages/os2/wfilters.html
but make sure that you read the documentation or the
source file, as appropriate, before using them, because
some of them have to be customised to your own situation.

WARNING

If you are upgrading from version 1.64 (or earlier)
of Weasel, you will find that there
are new rules for filters.  More precisely, the
rules changed during the time that beta versions
1.643 up to 1.646 were being tested.  With the release
of version 1.65, the new system was made generally
available to all users.

This does mean, however, that if you are using any
Weasel filters you will have to modify them.  The
filters on my ftp server and "Weasel filters" web page
have already been updated.  For other filters that you
have developed yourself, you will have to make the changes
yourself.  Fortunately, the change is minor.

Starting with version 1.643, parameters are passed to
a filter in the opposite order from what was used in
older versions.  The old system was to call a filter
with a call like

        Filterprog messagefile recipients

where 'messagefile' is the name of the file containing
the e-mail message that has just been received, and
'recipients' is the name of the file that contains the
e-mail addresses of the sender and recipients.

The new system is to call

        Filterprog namefile messagefile

which is the same except for the order of the parameters.
When you read the manual you will see why: there are some
situations where there is no messagefile parameter.
Furthermore, the namefile contains more information than
it had in earlier versions.

Your new Weasel.exe will continue to use the old system
until the first time you run Setup.exe.  After that, it
will use the new system.  (Because running Setup causes an
obsolete key to be deleted from WEASEL.INI.)

After correcting the order of the parameters, and running
Setup, your filters should continue to work as before.  But
there are now more ways to do filtering than there used to
be, so you might want to redesign your filters anyway.

Filters may be called at five different stages (called
stage 0 to stage 4) during the reception of an incoming
message.  An old-style filter is now called a "stage 4
filter".  If you want to use your existing filters with
minimal changes, just let them be stage 4 filters, and
leave the filter fields for stages 0 to 3 in the Setup
notebook blank.  A blank name at any stage means, of course,
that a filter will not be called at that stage.

The information in the "namefile" passed to the filter now
has more detail than it had in earlier versions:

   line 1:  client's true IP address and true hostname
   line 2:  client's claimed name, as given in the
            HELO or EHLO command
   line 3:  the argument of the MAIL FROM command
   line 4:  an empty line
   remaining lines: the recipients, one per line.

(Special cases: at stage 0, only line 1 exists because
the remaining information is not yet available.  At
stage 1, we have only lines 1 and 2.  At stage 2, we have
lines 1 to 3.  All of the namefile information is
present at stages 3 and 4, but it is only at stage 4 that
we also have a messagefile.)

The motivation for the empty line 4 is that this will
simplify the rewriting of filters if we ever have to
change these rules again.  The blank line creates an
effective separation between 'header' and 'body'
information, so filters that don't need all that detail
can skip directly down to the first empty line.

The line 3 information, plus all the recipient addresses,
are e-mail addresses in the usual user@domain format.

For more information on the new filtering system, see
WEASEL.INF for the details.  Note that you
don't have to use the extra stages if you don't want to.
Most typically, I would expect people to use filters at
no more than two of the stages, with the other filter
names left blank.  (In fact, I would expect the majority
of filters to be used only at the final stage.)  The
extra stages are to give you more choice, but I would
expect that extra choice to be exploited only by the
authors of very complicated filters.

