[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vps-mail] spam and procmail tricks



On Mon, Jan 30, 2006 at 06:13:07PM +0100, ADNET Ghislain wrote:
> Hi,
> 
>   I have a little problem on a VPS.
> 
>  I wanted to send all spam to a pop account but in the server's
> procmailrc and not in one of the user's procmailrc.. I used:
> 
> :0:
> * ^X-Spam-Flag: YES
> ! postmaster
> 
> but it was looping on itself sending to postmaster the email then back
> to postmaster in a loop.

So you want to add some loop detection:

    ## deliver seen messages immediately
    :0
    * H ?? ^X-Loop: postmaster
    { SWITCHRC }

    ## find spammy messgages we haven't seen yet
    :0
    *   H ?? ^X-Spam-Flag: YES
    * ! H ?? ^X-Loop: postmaster
    {
      ## ... and tag them
      :0 fw
      | formail -I "X-Loop: postmaster"

      ## now resend the message to postmaster (will get caught in the
      ## recipe above)
      :0
      ! postmaster
    }

I haven't tested this, but it should be pretty close.

Scott
-- 
Scott Wiersdorf
scottw@xxxxxxxxxxxx
======================================================================
This is <vps-mail@xxxxxxxxxxxx>       <http://www.perlcode.org/lists/>
Before posting a question, please search the archives (see above URL).


Main Index | Thread Index
Match: Format: Sort by:
Search: