[pmmail-list] filters - multifilter

Dave Saville pmmail-list@blueprintsoftwareworks.com
Tue, 26 Aug 2003 21:01:55 +0100 (BST)


Below is a rexx cmd file to use for pmmail incoming., It contains a
list of filters and runs them sequentially. Based on the weasel
multifiter.

You may need to change the path to perl, if you have it installed, if
not it does not matter as it will not be trying to use perl scripts
:-) You could use it to invoke a perl filter instead of a rexx one.
Seems to be working OK on my system. Bogofilter does its stuff and
then my little perl script removes Re: & friends from the subject so
that sorting by subject then date works. 


/****************************************************************/
/*                 Filter for use with PMMail                   */
/*                                                              */
/*   Modified from multifilter.cmd as shipped for weasel        */
/*                                                              */
/*   Dave Saville August 2003                                   */
/*                                                              */
/*   dave.saville@ntlworld.com                                  */
/*                                                              */
/*   The function of this filter is to call a sequence of       */
/*   other filters.  This allows you to take filters written    */
/*   by other people, and in effect combine them without        */
/*   having to rewrite the individual filters.                  */
/*                                                              */
/*      STATUS:       Working                                   */
/*                                                              */
/*      Author:       Peter Moylan (peter@ee.newcastle.edu.au)  */
/*      Started:      30 October 2001                           */
/*      Last revised: 04 May 2002                               */
/*                                                              */
/*  Installation:                                               */
/*      Change the assignment to string variable FiltersToCall  */
/*         (see below, line 29 of this script) to make it a     */
/*         comma-separated list of the individual filter        */
/*         programs that you want to call.                      */
/*                                                              */
/****************************************************************/

FiltersToCall = "D:\Apps\SouthSide\User_Tools\pmm_bogofilter.cmd,
d:\bin\pmmail_dere.pl"

CALL RxFuncAdd SysLoadFuncs, rexxutil, sysloadfuncs
CALL SysLoadFuncs

PARSE ARG File

DO WHILE (FiltersToCall \= '')
    PARSE VAR FiltersToCall ThisFilter ',' FiltersToCall
    k = LASTPOS('.', ThisFilter)
    IF (k>0) & (TRANSLATE(SUBSTR(ThisFilter, k+1)) = 'CMD') THEN
        INTERPRET 'CALL "'STRIP(ThisFilter)'" File'
    ELSE IF (k>0) & (TRANSLATE(SUBSTR(ThisFilter, k+1)) = 'PL') THEN
DO
            '@d:\usr\bin\perl.exe 'STRIP(ThisFilter) File
	END
    ELSE	  
        DO
            '@'ThisFilter File
        END
END


-- 
Regards

Dave Saville
- pmmail-list - The PMMail Discussion List ---------------------------
To POST to the list, send your message to:
pmmail-list@blueprintsoftwareworks.com

To UNSUBSCRIBE, send a message to mdaemon@bmtmicro.com 
with the first line of the message body being...
UNSUBSCRIBE pmmail-list@blueprintsoftwareworks.com
---------------------------------------------------------------------