Re: [CSCMail-Users] Attachments
Brought to you by:
countzer0
From: Count Z. <cou...@cy...> - 2001-12-08 22:51:25
|
Ok, I have commited a fix that actually works, but I don't like it... hehe The MIME::Parser module that we use to decode MIME messages has a "decode_header" option, that I have now turned on. However, it is evil: (quoting from the manpage) decode_headers [YESNO] Instance method. Controls whether the parser will attempt to decode all the MIME headers (as per RFC-1522) the moment it sees them. This is not advis able for two very important reasons: · It screws up the extraction of information from MIME fields. If you fully decode the headers into bytes, you can inadvertently transform a parseable MIME header like this: Content-type: text/plain; filename="=?ISO-8859-1?Q?Hi=22Ho?=" into unparseable gobbledygook; in this case: Content-type: text/plain; filename="Hi"Ho" · It is information-lossy. An encoded string which contains both Latin-1 and Cyrillic characters will be turned into a binary mishmosh which simply can't be rendered. Evil or not, it does solve this problem... However, it also causes the filename to be "Philippe" instead of "Philippe Amrein.doc" The mime-type is ok, so it will still open in any program that can understand files of type: application/ms-word The MIME::Parser and MIME::Parser::Filer documentation makes it look like this method should be un-needed in the current version, however, without turning this on, the file end's up named "1" which is worse in my mind. Supposedly MIME::Parser::Filer runs the filename through MIME::Words to decode it, once it has encountered the entity, but as we see in the error message, it doesn't seem to understand the "windows-1252" character set (of course, MIME::Words handles it just fine, as that is what I used in the last fix to make the name display correctly in the attachment menu) So, anyway, I will be contacting the MIME::Parser maintainer to see if we can get a "real" fix to this problem. For now, the current CVS will allow you to deal with this encoded header messages internally to CSCMail, without needing to jump through import/export hoops. The filenames might get munged a little, but at least you can get at the data. -CZ ----- Original Message ----- From: Daniel Schregenberger <np...@gm...> To: Count Zero <cou...@cy...> Sent: Saturday, December 08, 2001 5:46 PM Subject: Re: [CSCMail-Users] Attachments > ok, here it is! > > Daniel > > > Count Zero wrote: > > > Please forward the message to me, as a file attachment if you can (ie: > > export the message to a single file and then send that to me as an > > attachment.) > > > > Thanks! > > > > -CZ > > > > ----- Original Message ----- > > From: Daniel Schregenberger <np...@gm...> > > To: Count Zero <cou...@cy...> > > Sent: Saturday, December 08, 2001 3:23 PM > > Subject: Re: [CSCMail-Users] Attachments > > > > > > > Updating was no problem, all the '?' and '=' chars in the attachments name > > have > > > disappeared, but I'm unable to save it (and i'm not sure if viewing really > > > works, i think it should show more than just a few lines, but this could > > be due > > > to the fact i'm using antiword (a console program) to view M$-word > > documents.) > > > I dont think it is the space in the filename, because other attachments > > with > > > spaces in their names can be saved. > > > unfortunately i havent found a second MIME-encoded message, so I'm not > > able to > > > say if its special with this file. > > > I can forward you that mail if you want to. > > > > > > Daniel > > > > > > > > > Count Zero wrote: > > > > > > > Ok, these are MIME encoded filenames... I just added support for this, > > and > > > > checked it into CVS... Please checkout the current CVS code and let me > > know > > > > if it solves this problem... It should transparently fix it for exis ting > > > > mail as well as new mail. > > > > > > > > Let me know, > > > > > > > > -CZ > > > > > > > > ----- Original Message ----- > > > > From: Daniel Schregenberger <np...@gm...> > > > > To: CSCMail-Users <csc...@li...> > > > > Sent: Saturday, December 08, 2001 9:31 AM > > > > Subject: [CSCMail-Users] Attachments > > > > > > > > > > > > > I've encountered some problems with attachments sent by > > windows-clients > > > > (Opera, > > > > > Notes, ...). They are using some kind of code for the filename instead > > of > > > > a > > > > > "normal" filename. > > > > > The problem is that cscmail fails to save or view these attachments, I > > > > think > > > > > because of the '?' and '=' chars in the filename. > > > > > > > > > > Is there a better way to see these attachments nevertheless than > > exporting > > > > the > > > > > mail, modifying the attachment-filename and importing it again? > > > > > > > > > > I've added an attachment-header to show what I mean. > > > > > > > > > > Daniel > > > > > > > > > > PS: I've also seen some Mac-Clients sending attachments named > > > > > "blah/blahblah/blah/file.ext" It's the same problem with them. > > > > > > > > > > > > > > > Content-Disposition: attachment; > > > > > filename==?windows-1252?Q?Philippe=20Amrein.doc?= > > > > > Content-Type: application/msword; > > > > > name==?windows-1252?Q?Philippe=20Amrein.doc?= > > > > > Content-Transfer-Encoding: Base64 |