procmail
[Top] [All Lists]

Re: Stripping bad attachments

2005-01-20 17:53:26
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

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

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"

    {
       :0f
       | /path/to/demime

       SHELL=/bin/sh

why?

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

again, why?

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

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


-- 
<http://2blog.kreme.com/blog/2944/Twas_the_Night_Before_Christmas>

____________________________________________________________
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