procmail
[Top] [All Lists]

Re: would this work in a recipe?

2002-05-02 13:12:47
On another note, why use ^Content-Type? if you look at the Content-Type of
an email you do not get a filename extension...

Content-Type: multipart/alternative;
 boundary="----=_NextPart_001_01AB_01C1F1F2.D3C383B0"

But in Content-Disposition you do get a filename extension...

Content-Disposition: attachment;
 filename="sndrec.wav"

So how would procmail find .doc and .xls in Content-Type.................

Please clarify, thank you.

Pantelis H.

----- Original Message -----
From: "Professional Software Engineering" 
<PSE-L(_at_)mail(_dot_)professional(_dot_)org>
To: <procmail-users(_at_)procmail(_dot_)org>
Sent: Thursday, May 02, 2002 1:43 PM
Subject: Re: would this work in a recipe?


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


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