Matt Goodman | 5 Sep 2011 11:21

Maildroprc and Maildirmake

Hello all,

 

I am trying to have maildrop do two things when it finds a spam message:

 

1)      check to see if the .Spam folder exists, if it doesn’t then maildirmake it

2)      deliver Spam to .Spam folder

 

The problem is, all mail is being sent to the .Spam folder even non-spam mail L Can anyone take a look and see what I might be doing wrong?

 

PS – I am just testing against the subject right now, but will later move to test against the headers. I am aware of the issues with testing the header but this is just to get started.

 

 

#

SHELL="/bin/sh"

USER="$5"

HOST="$6"

MAILHOME="/var/vmail"

DEFAULT="$MAILHOME/$HOST/$USER"

logfile "/var/vmail/maildrop.log"

 

if (/^Subject: ***Spam***/)

 

    {

        `test -d $MAILHOME/$HOST/$USER/.INBOX.Spam`

 

        if( $RETURNCODE != 0)

 

           {

           `maildirmake -f INBOX.Spam $MAILHOME/$HOST/$USER`

           }

 

    exception {

        to $MAILHOME/$HOST/$USER/.INBOX.Spam/

        }

    }

 

Thanks,

 

Matt

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Sam Varshavchik | 5 Sep 2011 14:13
Gravatar

Re: Maildroprc and Maildirmake

Matt Goodman writes:

> The problem is, all mail is being sent to the .Spam folder even non-spam mail  
> L Can anyone take a look and see what I might be doing wrong?

You have a blank line between the line with the if statement, and the  
opening brace. maildrop's syntax is picky. This is mentioned in the man page.

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

Gmane