6.0.0-git
2019-03-18

[#129] attachment filename decode problem
Summary attachment filename decode problem
Queue IMP
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners jan (at) horde (dot) org, slusarz (at) horde (dot) org
Requester david (at) tmv (dot) gov (dot) tw
Created 2004-04-27 (5438 days ago)
Due
Updated 2010-11-13 (3047 days ago)
Assigned 2008-06-07 (3936 days ago)
Resolved 2008-06-09 (3934 days ago)
Milestone
Patch No

History
2010-11-13 00:29:46 gregvoronov (at) gmail (dot) com Comment #49 Reply to this comment

[Show Quoted Text - 10 lines]
Sorry for this. It appears to be initially Gmail issue 
http://mail.google.com/support/bin/answer.py?hl=en&answer=9524

When I checked the same on other mail gate, everything was working as 
it had to be.
2010-11-12 23:03:45 gregvoronov (at) gmail (dot) com Comment #48
New Attachment: webmailscreenshot.JPG Download
Reply to this comment
[root@SVP11398 ~]# cat /usr/share/psa-horde/lib/version.php
<?php define('HORDE_VERSION', '3.3.6') ?>
[root@SVP11398 ~]# rpm -qa | grep horde
psa-horde-3.3.6-cos5.build95101022.06
[root@SVP11398 ~]#

This error still persist for Chinese Traditional and Simplified 
locales. When trying to send an email with attachment labeled with 
like  ????? gmail received it like "noname" attachment. All that 
tricks below with php scripts didn't helped for me. Please advice.
2008-06-09 17:33:21 Michael Slusarz Comment #47
State ⇒ Resolved
Reply to this comment
Fixed in Horde 3.2.1.
2008-06-07 16:01:54 Chuck Hagenbuch Taken from Horde DevelopersHorde Developers
 
2008-06-07 16:01:41 Chuck Hagenbuch Comment #44
Assigned to Jan Schneider
Assigned to Michael Slusarz
State ⇒ Assigned
Reply to this comment
Can you take another look at this?
2008-06-07 02:10:01 Chuck Hagenbuch State ⇒ Feedback
 
2008-06-06 08:49:37 david (at) tmv (dot) gov (dot) tw Comment #43 Reply to this comment
I confirmed Felix's rawurlencode works fine and solves the whole
problem easily and beautifully.
Environment:

horde 3.1.7

imp 4.1.6

Confirm here also.



david
2008-06-06 08:36:33 poming168 (at) gmail (dot) com Comment #42 Reply to this comment
I confirmed Felix's rawurlencode works fine and solves the whole 
problem easily and beautifully.



Environment:

horde 3.1.4

imp 4.1.4



Though it is a bug of IE, however users do not concern the bug is on 
IE, or IMP, they will just urge you to fix it ASAP. We can know this 
problem are mostly about the filename characters are not in English, 
such as swedish, Chinese Traditional, Chinese Simplified, so I think 
many peoples hope there is a workaround solution to fix this problem.



Just know this problem was found by david on 04/27/04, over 4 years 
already... but I tested this problem still exists on imp 4.1.4





Ming
2006-10-02 05:39:28 felix5ng (at) yahoo (dot) com (dot) hk Comment #41 Reply to this comment
I found that IE doesn't accept non-ASCII URL,  the information from 
www we should use urlencode to encode the filename.

I tested this on my system (win XP TC, Win XP Eng, Win2K TC, Win2K 
Eng, Win Me TC) for chinese filename. it's OK

However I found two functions( rawurlencode, urlencode ) in php do 
similar job, I don't known which one is best for this job.

I try both on my test, both are OK for my test filename.

Not only IMP but also gollem

I hope someone can test this solution on other lang system.





I modifity the file horde/lib/Horde/Browser.php, function downloadHeaders

inside the code that special for msie



Below is the code

         /* MSIE doesn't like multiple periods in the file name. Convert

            all periods (except the last one) to underscores. */

         if ($this->isBrowser('msie')) {

             if (($pos = strrpos($filename, '.'))) {

                 $filename = strtr(substr($filename, 0, $pos), '.', 
'_') . substr($filename, $pos);

             }

             /* add the follow line  to encode the filename */

             $filename = rawurlencode($filename);

         }


2005-08-12 14:54:17 Jan Schneider Comment #40
State ⇒ Not A Bug
Reply to this comment
Oops, should have been marked as bogus. It's definitely a browser bug, 
and as long as noone finds a *valid* workaround, the bug stays bogus
2005-08-12 14:53:14 Jan Schneider State ⇒ Resolved
 
2005-08-01 22:44:23 devel (at) skolmail (dot) finspong (dot) se Comment #39 Reply to this comment
I'm aware it's a dirty trick, but as long as it only does the dirty 
stuff on IE browser, it shouldn't mess things up for others.

I'd like to have it in the admin setup for IMP or Horde. A setting for 
yes or no, enabling the dirty trick or not.

That way the hack can help people overcome this problem, but we are 
fairly clear about what we think of it; it shouln't need to be there 
in the first place.

Or IE should be OpenSource? Ouch, got a buzz from my keyboard.



At least for me, this has been a major issue as our entire org uses 
IE. So going from H2 to H3 has been delayed for almost a year. H2 used 
ISO-8859-1 all over so wasn't this problem (but other). And I failed 
on my last fix attempt.



Anyway, you guys have done a great job with Horde/IMP etc. Thank you!



/Peter


2005-07-31 10:11:59 Jan Schneider Comment #38 Reply to this comment
Is this solution a valid workaround for this problem?  It seems to be
working for several people...
No, it's only a workaround for IE that is ignoring the Content-Type: 
;charset header and will probably break for any sane browser.
2005-07-31 03:05:49 Michael Slusarz Comment #37
State ⇒ Feedback
Reply to this comment
Is this solution a valid workaround for this problem?  It seems to be 
working for several people...
2005-07-31 02:21:16 david (at) tmv (dot) gov (dot) tw Comment #36 Reply to this comment
Hello David.

Glad it worked out for you.

How about the download all attachments as zip-file issue. Have you
had problems with that too, abd have you found any (good) solution?
It's a problem for me too,and have not any solution,yet. (may try & error)
/Peter
David


2005-07-31 01:39:17 devel (at) skolmail (dot) finspong (dot) se Comment #35 Reply to this comment
Hello David.



Glad it worked out for you.



How about the download all attachments as zip-file issue. Have you had 
problems with that too, abd have you found any (good) solution?



/Peter
2005-07-29 01:28:07 david (at) tmv (dot) gov (dot) tw Comment #34 Reply to this comment

[Show Quoted Text - 33 lines]
Hi Peter, it did work for me,thank you.

I also modified "ISO-8859-1"  to NLS::getEmailCharset() ,because BIG5 
is my prefer language.
2005-07-28 21:33:03 devel (at) personal (dot) finspong (dot) se Comment #33 Reply to this comment
Just restarted on a upgrade from H2 to latest H3/IMP.



I have similiar problems with swedish characters on attachment download.



I have, as far as I can tell solved it for use at our site (very quick 
and dirty).



Maybe it helps someone else? Maybe someone can implement it correctly...



Anyway, as far as I can tell, on single file download Firefox works 
with swedish characters but IE doesn't. For me converting the sent 
filename from "UTF-8" to "ISO-8859-1" solves the problem.

So, in file imp/view.php, line 122 has been changed to (4 lines):

     if (($browser->getBrowser() == 'msie') && ($browser->getMajor() >= 5))

       $name = iconv("UTF-8", "ISO-8859-1", $mime->getName(true, true));

     else

       $name = $mime->getName(true, true);



I am aware that this will probably break for other languages, but for 
our swedish school environment it does the trick. Just did it today, 
so I will evaluate it more, but still...



Also, when downloading attachments in a single zip file, the filenames 
are wrong in zip file.

Made an even uglier hack for that:

File view.php, line 96 (1 line):

         $tosave[] = array('data' => $mime->getContents(), 'name' => 
iconv("UTF-8", "850", $mime->getName(true, true)));

Apparently WinZip in my case likes it this way. Will check more (and 
with Linux browsers).



/Peter


2005-02-07 10:05:22 Jan Schneider Comment #32
State ⇒ Not A Bug
Reply to this comment
Doing some more research, I found that this seems to be a known issue 
with IE that noone was able to workaround yet. Closing as we can't do 
anything about it at the moment.
2005-01-16 14:27:51 Jan Schneider Comment #31
Summary ⇒ attachment filename decode problem
Reply to this comment
I can reproduce it, only with IE. But I doubt we could do anything 
about this. Firefox shows that we are obviously sending the correct 
data.
2005-01-16 06:29:40 david (at) tmv (dot) gov (dot) tw Comment #30
New Attachment: imp_view.gif Download
Reply to this comment
Hi,chuck

Does your word application popup then open it ,or your browser can 
save the attachment with *.doc directly ?



The .doc part's shown with correct chinese name in my imp message 
view(see imp_view.gif),but can not be judged in download-dialog 
window(see download-dialog.gif).



What can i do next for this ticket ?




2005-01-16 03:24:12 Chuck Hagenbuch Comment #29
State ⇒ Feedback
Reply to this comment
Looks to work just fine to me.
2005-01-15 15:49:32 Jan Schneider State ⇒ Assigned
Assigned to Horde DevelopersHorde Developers
 
2005-01-15 05:56:53   New Attachment: download-dialog.gif Download
 
2005-01-15 05:56:07 david (at) tmv (dot) gov (dot) tw Comment #28
New Attachment: test.eml Download
Reply to this comment
Thank you,chuck.



Source message and download dialog screen-shot were  attached .

This situation only happen in I.E,firework works fine.
2005-01-15 04:57:13 Chuck Hagenbuch Comment #27 Reply to this comment
There are currently no attachments to this ticket. If you upload a 
complete message that allows us to reproduce the problem, then someone 
might be able to help you. Though Jan certainly tried.
2005-01-14 03:31:23 david (at) tmv (dot) gov (dot) tw Comment #26 Reply to this comment
Can someone else confirm this bug ?

Although i am not php coder and not good in php programing,but  till 
IMP4 ,the problem still there for a long long time.
2004-07-24 04:47:21 Chuck Hagenbuch Comment #25
State ⇒ Resolved
Reply to this comment
This won't be resolved unless David does the coding, which he doesn't 
seem to want to do. Killing.
2004-05-31 11:19:27 Jan Schneider State ⇒ Stalled
 
2004-05-11 23:54:13   Comment #24
New Attachment: test_attachment_s_filename_decode(yahoo).eml
Reply to this comment
This is the mail source,saved from IMP
2004-05-11 23:54:12 david (at) tmv (dot) gov (dot) tw Comment #23 Reply to this comment
This is the mail source,saved from IMP
2004-05-11 23:52:10   Comment #22
New Attachment: attachment_source.gif
Reply to this comment
This is what the attachment source looks like in Notepad.
2004-05-11 23:52:09 david (at) tmv (dot) gov (dot) tw Comment #21 Reply to this comment
This is what the attachment source looks like in Notepad.
2004-05-11 23:50:07   Comment #20
New Attachment: download-dialogue[1].gif
Reply to this comment
This time ,filename seems to be decoded correctly in IMP


2004-05-11 23:50:06 david (at) tmv (dot) gov (dot) tw Comment #19 Reply to this comment
This time ,filename seems to be decoded correctly in IMP


2004-05-11 23:48:08   Comment #18
New Attachment: message_view.gif
Reply to this comment
I found if mail was sent through yahoo webmail,attachment could be 
decoded correctly (but incorrect in message view).



Here are some of snapshots in IMP and the test message sent from yahoo.
2004-05-11 23:48:07 david (at) tmv (dot) gov (dot) tw Comment #17 Reply to this comment
I found if mail was sent through yahoo webmail,attachment could be 
decoded correctly (but incorrect in message view).



Here are some of snapshots in IMP and the test message sent from yahoo.
2004-05-11 13:09:18 Jan Schneider Comment #16 Reply to this comment
Seems to be browser problem, Mozilla save this file fine while IE 
mangles the characters. No idea how to fix that.
2004-05-11 13:01:43 david (at) tmv (dot) gov (dot) tw Comment #15 Reply to this comment
The decode problem was just happen in pop-up download dialogue,in imp 
message view it looks correct.



Outlook express work good for me too,but IMP not.



I guess maybe outlook could decode both Big5 & Utf8 but IMP not ,so it 
works for outlook.
2004-05-11 11:21:32 Jan Schneider Comment #14
State ⇒ Feedback
Reply to this comment
I don't see what's wrong there. If I import the message in Outlook 
Express or IMP, both show the same filename and try to save it with 
that name.
2004-05-11 10:27:06   Comment #13
New Attachment: test_attachment_s_filename_decode.eml
Reply to this comment
Here is the message source.



Thank you,Jan.
2004-05-11 10:26:25   Comment #12
New Attachment: download-dialogue.gif
Reply to this comment
Snapshot for Download dialogue in Windows/2000 IE6.0



filename has been decoded as utf-8,bad.

It should be decoded as Big5.




2004-05-11 10:26:24 david (at) tmv (dot) gov (dot) tw Comment #11 Reply to this comment
Snapshot for Download dialogue in Windows/2000 IE6.0



filename has been decoded as utf-8,bad.

It should be decoded as Big5.




2004-05-11 10:22:26   Comment #10
New Attachment: message.gif
Reply to this comment
Snapshot in IMP's message view
2004-05-11 10:22:25 david (at) tmv (dot) gov (dot) tw Comment #9 Reply to this comment
Snapshot in IMP's message view
2004-05-11 08:40:48 Jan Schneider Comment #8
State ⇒ Assigned
Reply to this comment
I'm a bit out of ideas now. Can you post updated screenshots again 
(the old ones unfortunately got lost) and the relevant part of the 
message source?
2004-05-11 00:33:42 david (at) tmv (dot) gov (dot) tw Comment #7 Reply to this comment
It still not work for me,even imp was u2date.


2004-05-10 22:17:07 Jan Schneider Comment #6
State ⇒ Resolved
Reply to this comment
Should be fixed in CVS now.
2004-04-27 04:45:32   Comment #5
New Attachment: 2.gif
Reply to this comment
Snapshot for download dialogue
2004-04-27 04:45:31 david (at) tmv (dot) gov (dot) tw Comment #4 Reply to this comment
Snapshot for download dialogue
2004-04-27 04:44:46   Comment #3
New Attachment: 1.gif
Reply to this comment
Snapshot in IMP screen 1
2004-04-27 04:44:45 david (at) tmv (dot) gov (dot) tw Comment #2 Reply to this comment
Snapshot in IMP screen 1
2004-04-27 04:43:39 david (at) tmv (dot) gov (dot) tw Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Queue ⇒ IMP
Reply to this comment
Hi there:

While click "Download" icon in IMP to save attachment,in the pop-up 
download dialogue screen.If Attachment named in Chinese the filename 
seems not decode correctly.




Saved Queries