Hi Stephen,

just modify your maildroprc so that the users .mailfilter is only
included if no spam was detected:

if ( $SIZE < 204800 )
   {
       exception {
           xfilter "/usr/bin/spamassassin"
       }
   }

   if (/^X-Spam-Flag: YES/)
   {
       if (/^X-Spam-Level: \*\*\*\*\*\*/)
       {
           echo "***** Dropping 6+ Spam *****"
           EXITCODE = 0
           exit
       }
       else
       {
           to "$HOME/Maildir/.Trash/"
       }
   }
# spam messages were already handled
  `test -r $HOME/.mailfilter`
  if( $RETURNCODE == 0 )
        {
        log "(==)  Including $HOME/.mailfilter"
                exception {
                        include $HOME/.mailfilter
                }
        }
   to "$HOME/Maildir/"


That should do the trick. On a side note I would recommend switching
to Spamassassins client-server model and using spamc instead of the
spamassassin executable.

HTH
  Marcus

On 10/11/06, Stephen Reese <[EMAIL PROTECTED]> wrote:
>
> I'm using the following script for spamassassin to send junk to the Trash
> folder. The .mailfilter files are read and work, but when fowarding mail to
> another email address the spam is also fowarded which is not desirable. I'm
> looking for a method to continue to forward mail, but not also foward the
> spam which the current setup does.
>
> Here's the .mailfilter file:
> cat /home/sreese/.mailfilter
> cc "[EMAIL PROTECTED]"
> EXITCODE = 0
> exit
>
> Here's the maildroprc:
> cat /usr/lib/courier/etc/maildroprc
> if ( $SIZE < 204800 )
>    {
>        exception {
>            xfilter "/usr/bin/spamassassin"
>        }
>    }
>
> `test -r $HOME/.mailfilter`
> if( $RETURNCODE == 0 )
>         {
>         log "(==)  Including $HOME/.mailfilter"
>                 exception {
>                         include $HOME/.mailfilter
>                 }
>         }
>
>    if (/^X-Spam-Flag: YES/)
>    {
>        if (/^X-Spam-Level: \*\*\*\*\*\*/)
>        {
>            echo "***** Dropping 6+ Spam *****"
>            EXITCODE = 0
>            exit
>        }
>        else
>        {
>            to "$HOME/Maildir/.Trash/"
>        }
>    }
>    to "$HOME/Maildir/"
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to