procmail
[Top] [All Lists]

Re: Attachments

1997-05-26 07:53:00
On Mon, 26 May 1997 11:15:13 +0200 (MET DST),
Bernard El-Hagin <sokrates(_at_)sound(_dot_)eti(_dot_)pg(_dot_)gda(_dot_)pl> 
wrote:
If I set up a simple filter like:
:0
*>10000
/dev/null
will this weed out mail that's over 10kB because of an attachment or just
mail that has more than 10kB in its body? 

Neither; it matches anything where headers plus body exceeds 10,000
bytes. 

If this won't work for attachments how do I filter out mail that's too
large because of attachments? 

How about something like 

    :0
    * > 10000
    * ^Content-type:
    * ! ^Content-type:[  ]*(text|message)
    {
        EXITCODE=77
        HOST
    }

This should generate a bounce instead of just make the message
disappear. (This is of course not very bright for messages from
mailing lists -- those could probably go to /dev/null without
remorse.) [The stuff in the brackets is a space and a tab as usual.]

  BTW, if anyone hasn't seen Era's website yet, DO IT NOW!!!
Sorry Era, but the site is amazing and I think everyone should see it :)

Thanks :-)
  The offer for someone to spiff up the look of the pages is still
valid, though ... 

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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