procmail
[Top] [All Lists]

RE: Stripping bad attachments

2005-01-20 18:30:53
-----Original Message-----
Google Kreme

On Thu, 20 Jan 2005 17:33:51 -0600, Pettit, Paul 
<ismanager(_at_)ccbnpts(_dot_)com> wrote:
:0
*^Content-type: (multipart/mixed|application/octet-stream)

^Content-type:.*(multipart/mixed|application/octet-stream)

{
    :0 HB

Don';t use H


Is that because procmail parses the Header by default or is that just a
personal preference?

    *^Content-Disposition: (attachment|inline);

why?

Why not?

To date this filter has worked 100%, in my experience if it isn't broken
don't fix it. All I want to do is "add" to how the filter works but if I
can't then the filter keeps plugging away. :)

I'm open to reasons why this should be changed but ... well ... why?


    *filename=".*\.(vbs|wsf|shs|exe|chm|pif|vbe|hta)"

This will work for most, but will fail if there is a new line, which
there often is in bad attachments:

filename =
    "badfile.src"


Never thought of that but so far I've never seen one slip through
because of that. Lucky maybe? I'll have to think up a way to cover for
this. Good catch. :)

    {
       :0f
       | /path/to/demime

       SHELL=/bin/sh

why?

Again, why not?

As far as I know it's to give a shell to run sed in. In all the examples
I've seen SHELL is defined.


       :0 fhbw
       |/usr/bin/sed \
- -e 's/^Subject:/Subject: **ATTACHMENT REMOVED**/'

again, why?

This is to prepend the message to the original subject that an
attachment was removed.


# Define $WS to contain a space and tab
:0
* $ ^Subject:$WS*\/[^$WS].*
{ SUBJECT=$MATCH }

:0 f
| formail -I "Subject: ATTACHMENT REMOVED (Was $SUBJECT)


Different method but same result as far as I can tell. The sed regex
statement does a fine job with low overhead so why switch it?

Didn't really answer the original question, will the modified filter
work? From what I can infer, it will but it'd be nice to know for sure.
I will test it out and let you know.

Paul P.


____________________________________________________________
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>