Re: extracting attachments
Professional Software Engineering <PSE-L <at> mail.professional.org>
2001-04-01 20:31:17 GMT
At 15:57 2001-04-01 -0400, Timothy J. Luoma wrote:
>I have sworn off email attachments for the rest of my life.
For some simple lists I run through procmail recipes, I run the incoming
messages through an attachment filter called stripmime
<http://www.phred.org/~alex/stripmime.pl> that strips them entirely, then
emits a footer text into the message indicating pieces have been removed
(problem was having a stated policy of "no attachments" didn't sink in with
people). I did some of my own tweaks to the helper app, and I would think
it could be tweaked to support what you're trying to do as well -- the
message itself could have the URL tacked right into the footer.
Actually, in the procmail rules on that account, I separatley check for
multipart and bounce a reminder text, THEN the MIME stripper is invoked as
a filter to eliminate everything except text/plain.
If you wanted to get really clever, the helper app could check to see if
the extracted attachment was the same as another (CRC32/size signature
possibly, followed by an outright comparison), and just point to
that. Then you don't have multiple copies of the same binary hanging on
your system (or of those damn .VCFs). With a helper script on the
webserver (perl cgi, or a PHP-enabled page), the URLs could point into this
helper which could manage renaming things to their original names (multiple
attachments with different names but the same content) and enforcing http auth.
>Content-Disposition: inline; filename="../../../../../../../../../../.rhosts"
1. Would require that the user under which procmail is being executed has
write perms to that _system_ file (arguably just another reason why root