From: Nicholas Clark Date: 11:21 on 03 Mar 2004 Subject: mail.app and zip file attachments So I've been forwarded a message, and it contains a zip file attachment. However, said zipfile has been made by hateful software, which has used backslashes instead of forward slashes as directory separators in the internal filenames. Strictly there is nothing wrong - the legal zip file contains files at the top level named foo\bar foo\baz etc, but the intent was clearly foo/ bar baz Now, I know that Infozip's unzip program is not hateful, and is smart enough to allow compensation for this hatefulness. However, can I get mail.app to save the attachment as a zip file? No way! Whatever I try, it insists on "helpfully" unzipping it for me. And it (correctly, but unhelpfully) takes a literal view on those backslashes. So I get crappy filenames with 3 levels of directory trees flattenened Oi! No. Stop trying to be clever, and let me detach the attachment still as a zip file. The only way the collective brains round here could outsmart the hateware was by saving the message in raw form (OK. at least it lets us do that, but hatefully it did put  in the filename it made from the subject line) and I used a REAL mail program (ie mutt) to save the zip attachment. At which point unzip can do its magic: $ unzip Localization-10-30-2003-6.22.57.PM.zip Archive: Localization-10-30-2003-6.22.57.PM.zip warning: Localization-10-30-2003-6.22.57.PM.zip appears to use backslashes as path separators Wah. I think I have a solution. I could just mail Apple 42.zip as an attachment: $ unzip -l 42.zip Archive: 42.zip Length Date Time Name ------ ---- ---- ---- 34902 03-28-00 21:40 lib 3.zip 34902 03-28-00 21:40 lib 1.zip 34902 03-28-00 21:40 lib 2.zip 34902 03-28-00 21:40 lib 0.zip 34902 03-28-00 21:40 lib 4.zip 34902 03-28-00 21:40 lib 5.zip 34902 03-28-00 21:40 lib 6.zip 34902 03-28-00 21:40 lib 7.zip 34902 03-28-00 21:40 lib 8.zip 34902 03-28-00 21:40 lib 9.zip 34902 03-28-00 21:40 lib a.zip 34902 03-28-00 21:40 lib b.zip 34902 03-28-00 21:40 lib c.zip 34902 03-28-00 21:40 lib d.zip 34902 03-28-00 21:40 lib e.zip 34902 03-28-00 21:40 lib f.zip ------ ------- 558432 16 files (etc, etc, etc) That'll teach them not to trust zip files. Nicholas Clark
From: peter (Peter da Silva) Date: 13:50 on 03 Mar 2004 Subject: Re: mail.app and zip file attachments > However, can I get mail.app to save the attachment as a zip file? No way! > Whatever I try, it insists on "helpfully" unzipping it for me. And it > (correctly, but unhelpfully) takes a literal view on those backslashes. So > I get crappy filenames with 3 levels of directory trees flattenened The first thing I do on any application that handles untrusted documents, mail software, web browser, what have you, is turn off all the options and flags that tell it to automatically unpack, open, launch, embed, or what have you any document or file format that it thinks is "safe to open". Doesn't matter the platform, the software, the OS, they all have this insanely stupid and irritating "helper", and I can not conceive of a time when I would want it to happen. > Oi! No. Stop trying to be clever, and let me detach the attachment > still as a zip file. Mail.app has a flag that'll do it, solve your problem, and who knows it may some day save you from an exploit (remote as that seems now). So here's MY hate for the day, software that for convenience sake makes the absolutely worst possible decision about unknown, possibly corrupted, possibly even malicious data. Microsoft has this bug the worst way, of course, with their browser integration, but everyone does it. Mozilla, Opera, iCab, Firefox, Netscape, all the mail software less than ten years old, instant messenger programs, streaming media players, network plug-n-play, now they're talking about having hardware trade code fragments over the network when it's booted to automatically adjust protocols and formats. It used to be that when I read science fiction about "sentient data packets" I figured that the writers didn't understand that network software never trusts code by default, that stuff couldn't possibly work, it was like the Good Times virus, right? A joke. Then Microsoft made Good Times real, but surely people will see this and quit using software that trades bodily fluids with any grimy hobo that grins around rotten teeth at it. But no, I was wrong, I underestimated the stupidity of the public... not only do people keep using this stuff, but it gets leakier and more agressively promiscuous, like it can't get enough wandering drug addicts so it has to go out on the street and hunt them down. And nobody cares. Not only don't they care, they don't see a problem, they argue with you even as you're pealing viruses out of their computer with rubber gloves and a pipe wrench that they should be an exception to the rule and you should let them keep on using Outlook. Or whatever sleazy tramp of a web/mail/news/IM client they're hooked on. Some days I want to see the whole lot of them, Apple, Microsoft, Mozilla, AOL, Real, every damn trampware vendor, sucked screaming down to hell by the suddenly physical tentacles they're metaphorically invoking. Hate Software? Hate's such a small concept to embrace this emotion.
Generated at 10:26 on 16 Apr 2008 by mariachi