Opened 4 years ago
Closed 4 years ago
#1485920 closed Bugs (wontfix)
Attachments with special chars in filename are displayed wrong
| Reported by: | rosali | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.3-stable |
| Component: | IMAP connection | Version: | git-master |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Content-Type: application/x-zip-compressed; name="=?iso-8859-1?B?beT2LnppcA==?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="=?iso-8859-1?B?beT2LnppcA==?="
results in ...
<ul id="attachment-list"><li><a href="./?_task=mail&_action=get&_uid=32148&_mbox=INBOX&_part=2" onclick="return rcmail.command('load-attachment',{part:'2', mimetype:'application/x-zip-compressed'},this)" title="">m蔕.zip</a></li>
</ul>
Page title and subject is decoded properly for same string (Subject: =?iso-8859-1?B?beT2LnppcA==?=)
Attachments (5)
Change History (20)
comment:1 Changed 4 years ago by alec
Changed 4 years ago by rosali
comment:2 Changed 4 years ago by rosali
Message attached.
comment:3 Changed 4 years ago by alec
Works for me. Please, do IMAP BODYSTRUCTURE debug.
comment:4 follow-up: ↓ 5 Changed 4 years ago by rosali
So, you see in the attachment link row "mäö.zip"?
Please goto http://mail4us.net/dev and click "Demo" ...
I have uploaded the test mail there. If it displays for you uncorrect as well, please advice how to IMAP BODYSTRUCTURE debug.
comment:5 in reply to: ↑ 4 Changed 4 years ago by alec
Replying to rosali:
So, you see in the attachment link row "mäö.zip"?
yes
I have uploaded the test mail there. If it displays for you uncorrect as well, please advice how to IMAP BODYSTRUCTURE debug.
Uncomment console() in lib/imap.inc and check logs/console
comment:6 Changed 4 years ago by rosali
[15-Jun-2009 05:14:04 -0400]: C: cp01 CAPABILITY
[15-Jun-2009 05:14:04 -0400]: S: * CAPABILITY IMAP4 IMAP4rev1 CHILDREN IDLE QUOTA SORT NAMESPACE ACL RIGHTS=texk
[15-Jun-2009 05:14:04 -0400]: S: cp01 OK CAPABILITY completed
[15-Jun-2009 05:14:04 -0400]: C: a001 LOGIN "demo3@…" "demo"
[15-Jun-2009 05:14:04 -0400]: S: a001 OK LOGIN completed
[15-Jun-2009 05:14:04 -0400]: C: sel1 SELECT "INBOX"
[15-Jun-2009 05:14:04 -0400]: S: * 7 EXISTS
[15-Jun-2009 05:14:04 -0400]: S: * 0 RECENT
[15-Jun-2009 05:14:04 -0400]: S: * FLAGS (\Deleted \Seen \Draft \Answered \Flagged)
[15-Jun-2009 05:14:04 -0400]: S: * OK [UIDVALIDITY 0]
[15-Jun-2009 05:14:04 -0400]: S: * OK [PERMANENTFLAGS (\Deleted \Seen \Draft \Answered \Flagged)]
[15-Jun-2009 05:14:04 -0400]: S: sel1 OK [READ-WRITE] SELECT completed
[15-Jun-2009 05:14:04 -0400]: C: FH12 UID FETCH 32290 (UID RFC822.SIZE FLAGS INTERNALDATE BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCES DISPOSITION-NOTIFICATION-TO X-PRIORITY)])
[15-Jun-2009 05:14:04 -0400]: S: * 1 FETCH (UID 32290 RFC822.SIZE 5363 FLAGS (\Seen) INTERNALDATE "15-Jun-2009 11:04:24 +0200" BODYSTRUCTURE ((("TEXT" "PLAIN" ("CHARSET" "iso-8859-1") NIL NIL "quoted-printable" 11 1)("TEXT" "HTML" ("CHARSET" "iso-8859-1") NIL NIL "quoted-printable" 344 10) "ALTERNATIVE" ("BOUNDARY" "----=_NextPart_001_0171_01C9ED9B.715C7BD0") NIL NIL)("APPLICATION" "X-ZIP-COMPRESSED" ("NAME" "mäö.zip") NIL NIL "base64" 3442 NIL ("attachment" ("FILENAME" "mäö.zip"))) "MIXED" ("BOUNDARY" "----=_NextPart_000_0170_01C9ED9B.715C7BD0") NIL NIL) BODY[HEADER.FIELDS (DATE FROM TO SUBJECT REPLY-TO IN-REPLY-TO CC BCC CONTENT-TRANSFER-ENCODING CONTENT-TYPE MESSAGE-ID REFERENCES DISPOSITION-NOTIFICATION-TO X-PRIORITY)] {384}
[15-Jun-2009 05:14:04 -0400]: [...] DATE: Mon, 15 Jun 2009 09:27:03 +0200
FROM: "Roland Liebl" <roland@…>
TO: "Roland Liebl" <roland@…>
SUBJECT: =?iso-8859-1?B?beT2LnppcA==?=
REPLY-TO: "Roland Liebl" <roland@…>
CONTENT-TYPE: multipart/mixed; boundary="----=_NextPart_000_0170_01C9ED9B.715C7BD0"
MESSAGE-ID: <8B5E6BE28E56425D9D578988B7D7C17A@arbeitszimmer>
X-PRIORITY: 3
[15-Jun-2009 05:14:04 -0400]: S: )
[15-Jun-2009 05:14:04 -0400]: S: FH12 OK UID completed
[15-Jun-2009 05:14:04 -0400]: C: ftch0 FETCH 1 (BODY.PEEK[2.MIME])
[15-Jun-2009 05:14:04 -0400]: S: * 1 FETCH (BODY[2.MIME] {194}
[15-Jun-2009 05:14:04 -0400]: S: Content-Type: application/x-zip-compressed; name="=?iso-8859-1?B?beT2LnppcA==?="
[15-Jun-2009 05:14:04 -0400]: S: Content-Transfer-Encoding: base64
[15-Jun-2009 05:14:04 -0400]: S: Content-Disposition: attachment; filename="=?iso-8859-1?B?beT2LnppcA==?="
[15-Jun-2009 05:14:04 -0400]: S:
[15-Jun-2009 05:14:04 -0400]: S: )
[15-Jun-2009 05:14:04 -0400]: S: ftch0 OK FETCH completed
[15-Jun-2009 05:14:04 -0400]: C: I LOGOUT
Changed 4 years ago by rosali
Changed 4 years ago by rosali
comment:7 Changed 4 years ago by alec
Fixes for #1484969 are probably regressions for your case. I'm not sure if it's right that your server returns decoded filename in UTF-8. Or maybe message was sent with wrong charset?
comment:8 Changed 4 years ago by rosali
Message was sent by Outlook Express. What's really confusion is, that it does not happen always. But I can't reproduce what is causing the problem.
F.e. the following filename is decoded correct:
Content-Type: application/x-zip-compressed; name="=?iso-8859-1?B?5Pb8LnppcA==?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="=?iso-8859-1?B?5Pb8LnppcA==?="
Changed 4 years ago by rosali
Changed 4 years ago by rosali
comment:9 Changed 4 years ago by rosali
Please look at attached get.inc and show.inc. My modifications are marked by "Find me".
I know it is not the right place to manipulate the filename here. But I can't find where this probperty is set in the $MESSAGE object. Nethertheless these modifications solve the problems for me.
comment:10 Changed 4 years ago by alec
We can't definetly handle this in such way. We should investigate if this is RFC-compliant behaviour that filename ("=?iso-8859-1?B?beT2LnppcA==?=") - encoded in iso-8859-1 is returned as UTF-8 by your IMAP server.
comment:11 Changed 4 years ago by rosali
Yes, please advice how I can assist (backend is hMailServer 5). If necessary I give you full remote access.
comment:12 Changed 4 years ago by alec
I think it's wrong that hmailserver return utf-8 encoded text. You should ask hmailserver developers.
comment:13 Changed 4 years ago by rosali
OK, maybe I could have a plugin hook to manipulate the $MESSAGE object in get.inc/show.inc? I fully understand that you won't fix other devs issues. But I need a workaround without to hack the source code and I can't wait until hMail Devs jump into this issue.
comment:14 Changed 4 years ago by rosali
I just noticed that I can use the 'load_message' hook. Please close the ticket if you are sure that hMailServer is not RFC-compliant in this point. But if so, it looks like Outlook Express is more tolerant; filenames are displayed there correctly.
comment:15 Changed 4 years ago by alec
- Component changed from Core functionality to IMAP connection
- Resolution set to wontfix
- Status changed from new to closed
Bug confirmed by hmailserver developer: http://www.hmailserver.com/forum/viewtopic.php?f=10&t=15394 Fixed in newer version of hMailServer.

Please, attach the whole message.