6.0.0-beta1
7/9/25

[#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 04/27/2004 (7743 days ago)
Due
Updated 11/13/2010 (5352 days ago)
Assigned 06/07/2008 (6241 days ago)
Resolved 06/09/2008 (6239 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/13/2010 12:29:46 AM 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.
11/12/2010 11:03:45 PM 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.
06/09/2008 05:33:21 PM Michael Slusarz Comment #47
State ⇒ Resolved
Reply to this comment
Fixed in Horde 3.2.1.
06/07/2008 04:01:54 PM Chuck Hagenbuch Taken from Horde DevelopersHorde Developers
 
06/07/2008 04:01:41 PM 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?
06/07/2008 02:10:01 AM Chuck Hagenbuch State ⇒ Feedback
 
06/06/2008 08:49:37 AM 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
06/06/2008 08:36:33 AM 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
10/02/2006 05:39:28 AM 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);

         }


08/12/2005 02:54:17 PM 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
08/12/2005 02:53:14 PM Jan Schneider State ⇒ Resolved
 
08/01/2005 10:44:23 PM 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


07/31/2005 10:11:59 AM 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.
07/31/2005 03:05:49 AM 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...
07/31/2005 02:21:16 AM 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


07/31/2005 01:39:17 AM 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
07/29/2005 01:28:07 AM 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.
07/28/2005 09:33:03 PM 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


02/07/2005 10:05:22 AM 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.
01/16/2005 02:27:51 PM 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.
01/16/2005 06:29:40 AM 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 ?




01/16/2005 03:24:12 AM Chuck Hagenbuch Comment #29
State ⇒ Feedback
Reply to this comment
Looks to work just fine to me.
01/15/2005 03:49:32 PM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
01/15/2005 05:56:53 AM   New Attachment: download-dialog.gif Download
 
01/15/2005 05:56:07 AM 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.
01/15/2005 04:57:13 AM 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.
01/14/2005 03:31:23 AM 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.
07/24/2004 04:47:21 AM 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.
05/31/2004 11:19:27 AM Jan Schneider State ⇒ Stalled
 
05/11/2004 11:54:13 PM   Comment #24
New Attachment: test_attachment_s_filename_decode(yahoo).eml
Reply to this comment
This is the mail source,saved from IMP
05/11/2004 11:54:12 PM david (at) tmv (dot) gov (dot) tw Comment #23 Reply to this comment
This is the mail source,saved from IMP
05/11/2004 11:52:10 PM   Comment #22
New Attachment: attachment_source.gif
Reply to this comment
This is what the attachment source looks like in Notepad.
05/11/2004 11:52:09 PM david (at) tmv (dot) gov (dot) tw Comment #21 Reply to this comment
This is what the attachment source looks like in Notepad.
05/11/2004 11:50:07 PM   Comment #20
New Attachment: download-dialogue[1].gif
Reply to this comment
This time ,filename seems to be decoded correctly in IMP


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


05/11/2004 11:48:08 PM   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.
05/11/2004 11:48:07 PM 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.
05/11/2004 01:09:18 PM 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.
05/11/2004 01:01:43 PM 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.
05/11/2004 11:21:32 AM 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.
05/11/2004 10:27:06 AM   Comment #13
New Attachment: test_attachment_s_filename_decode.eml
Reply to this comment
Here is the message source.



Thank you,Jan.
05/11/2004 10:26:25 AM   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.




05/11/2004 10:26:24 AM 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.




05/11/2004 10:22:26 AM   Comment #10
New Attachment: message.gif
Reply to this comment
Snapshot in IMP's message view
05/11/2004 10:22:25 AM david (at) tmv (dot) gov (dot) tw Comment #9 Reply to this comment
Snapshot in IMP's message view
05/11/2004 08:40:48 AM 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?
05/11/2004 12:33:42 AM david (at) tmv (dot) gov (dot) tw Comment #7 Reply to this comment
It still not work for me,even imp was u2date.


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