procmail
[Top] [All Lists]

Re: would this work in a recipe?

2002-05-02 11:29:25
At 13:01 2002-05-02 -0400, Pantelis Hadzipantelis did say:

Is there a way to like say: if { ^Content-Disposition == !(*.doc && *.xls) } then { /dev/null }

Content-Disposition?


# Not technically accurrate to the MIME format, but then, neither is
# most stuff checking for attachment types or names anyway, and it's a
# far cry better than just nabbing ".doc" in the ...

:0
* ^Content-Type:.*multipart/
{
        :0B:
* ? grep -A1 -i ^Content-Type: | grep -i name | egrep -v -i \.\(doc\|xls\)\"?\;?$
        quarantine.mbx
}

Tweak as you see fit - I would suggest dumping them into a file for a while BEFORE you start simply discarding them or replying. If you have a mailbox load of messages which should - and should not - be matched, consider running a test of this in a sandbox (see .sig).

This also should generally work when say, someone sends a bogus .DOC - as a filename.doc.exe -- since the tail end of the expression expects appropriate trailers to the name specifier.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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