procmail
[Top] [All Lists]

Re: How to filter multiple image attachments?

2006-06-19 17:16:22
On Mon, Jun 19, 2006 at 11:27:45PM +0000, Jonesy wrote:
# Delete emails with 'excessive' <img> references 
 :0B
  * -6^0
  *  1^1 ()<img
     {
      X="$="
      LOG=">>>> DELETED - (6+$X) HTML <img> tag's $TOJONZ $NL"
      :0 fwh
      | formail -I"X-DELETED-SPAM: (6+$X) HTML <img> tag's ${TOJONZ}"
      :0:
      $DELETE
     }

It's your call as to how mant HTML <img... tags you'll accept.

Since we're now looking all the way through all the bodies of all
messages, let's abbreviate the effort procmail has to do.

First, let's only look in messages that could possibly contain
attachments.  Then, let's use the "Infinity Shuffle" to stop
looking once the desired threshold is reached.


  LIMIT  = 6
  MAXINT = 2147483647

  :0
  * ! ^Content-Type:(.*\<)?(attachment|multipart)
  * ! ^FROM_MAILER
  { }

  :0 E
  * $  -$LIMIT ^0
  * $  $MAXINT ^0
  *          1 ^1  B ?? ()<img
  #
  # if we're still here, the message had fewer then $LIMIT
  * $ -$MAXINT ^0
  { 
     ACTION
  }

-- 
Dallman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>