procmail
[Top] [All Lists]

Re: C/Perl modules to delete attachments ?

1998-01-12 10:40:26
On Mon, Jan 12, 1998 at 03:36:24PM +0200, 
jari(_dot_)aalto(_at_)poboxes(_dot_)com wrote:

Yes, it may be possible that any procmail script fails to understand
MIME in full. The specialized tools that are designed for mime are
the right ones when 100% accuracy is expected.

OK. Agreed.

| Frankly, MIME is a pretty simple format and I would want Era to explain
| exactly in which cases Jari's pm-jamimekill.rc might not produce expected
| results.

I think era just meant that using munpack would be another alternative.

Well, I did try munpack and Era agreed that it is not really suited for
this job in that it just splits a MIME message on stdin to output files
while what we need here is a tool that accepts arguments as to which MIME
part to delete and spits the rest of the message on stdout so that it can
be plugged into Procmail.

The only vulnerable part in the script is the additional line killing hint:

JA_MIME_KILL_RE = ${JA_MIME_KILL_RE:-"name=.*(pcx|PCX)|charset=|This 
is.*MIME"}

To be safe, you could set it to "#_#" (or anything that is guarranteed not to 
match , to be sure that nothing vulnerable won't be killed. Eg if you
receive perl script that happend to have

    next if /This is MIME multipart/;

That line would be wiped away. Hmm, I have to write note on this
to the documentation. Thanks.

OK I can see how sed/awk scripts are not 100% bulletproof. 

Arent there any utilities out there in C/Perl that anyone knows about that
be easily plugged into Procmail to do the kind of things we are talking
about? I find that quite unreal being that this is such a common/expected
request! (sigh)

Thanks guys,
Vikas

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