/****************************************************************/ /* Sample filter for use with Weasel */ /* */ /* This filter takes a copy of the incoming message and */ /* stores the copy in an 'Archive' subdirectory. */ /* */ /* Author: Peter Moylan (peter@ee.newcastle.edu.au) */ /* Started: 26 October 2000 */ /* Last revised: 26 October 2000 */ /* */ /* Installation: */ /* Put this file in the directory containing WEASEL.INI */ /* Put its name in the 'Options' page in Setup. */ /* Create a subdirectory 'Archive' under the mail root. */ /* Weasel needs to be restarted to recognise the change. */ /* */ /****************************************************************/ CALL RxFuncAdd SysLoadFuncs, rexxutil, sysloadfuncs CALL SysLoadFuncs PARSE ARG messagefile userlist /* Don't process outgoing messages destined for the forward directory */ if COMPARE(TRANSLATE(SUBSTR(messagefile,1,15)),TRANSLATE('e:\mail\forward')) = 0 then do SAY "FORWARD" return 0 end FILNAME=FILESPEC("name",messagefile) /* Postmaster messages are automatically spam */ if COMPARE(TRANSLATE(SUBSTR(messagefile,1,18)),TRANSLATE('e:\mail\postmaster')) = 0 then do say 'SPAM ' messagefile '@copy ' messagefile 'e:\bogofilter\spammail\'||FILNAME||'.msg' return 0 end '@e:\apps\bogofilter\bin\bogofilter -p -3 -I' messagefile '-Oe:\apps\bogofilter\temp.msg' cod=RC if cod=0 then do say 'SPAM ' messagefile '@copy ' messagefile 'e:\bogofilter\spammail\'||FILNAME||'.msg' end if cod=1 then do say 'GOOD ' messagefile '@copy ' messagefile 'e:\bogofilter\goodmail\'||FILNAME||'.msg' end if cod=2 then do say 'UNSURE ' messagefile '@copy ' messagefile 'e:\bogofilter\unsuremail\'||FILNAME||'.msg' end if cod=3 then say 'ERROR ' messagefile else '@copy e:\apps\bogofilter\temp.msg' messagefile /* Return to Weasel with an 'OK' return code. */ RETURN 0