Re: pre-announce exmh-2.7.2
Brent Welch <[email protected]>
| Newsgroups | gmane.mail.exmh.devel |
|---|---|
| Message-ID | <[email protected]> |
Dang - what a difference between a script that works great for me and something that is safe for others. >>>[email protected] said: > On Tue, 04 Jan 2005 17:15:27 PST, Brent Welch said: > > > It looks for a filename parameter in the content-type header. > > If you can think of ways to make exmh-strip more clever about > > chosing names, let me know. It turns out it looks for the "filename=" parameter in any header, which often means Content-Disposition: attachment; filename="whatever.doc" I also modified it to look for Content-Description: headers, and also name="whatever.doc" parameters. > A few notes: > > 1) In MimeStripPart, it probably needs to do some regexp magic to > sanitize the $filename, similar to what I added to the Save... dialog > code. How about set path [file tail $path] set path [string trim $path] if {[regexp {^\|} $path]} { catch {puts stderr "Bad filename $path"} exit 1 } > 2) I don't see where it does something intelligent if there's a > collision - > we're looking at Something Very Bad happening if you invoke it on two > different > pieces of mail that both have a 'foo.doc' attachment. Yup - I'll have it bail out if the file already exists. > 3) Does the display code DTRT (or *a* Right Thing) if the resulting > external reference goes dangling (because you've rm'ed the file out of > ~/attachments or whatever?) Yes, it looks like there is an error check for that already there. -- Brent Welch Software Architect, Panasas Inc Delivering the premier storage system for scalable Linux clusters www.panasas.com [email protected]