[#7680] gzip/bzip2 upload doubly compressed
Summary gzip/bzip2 upload doubly compressed
Queue IMP
Queue Version HEAD
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester marc (at) r4l (dot) com
Created 11/13/2008 (233 days ago)
Due
Updated 12/09/2008 (207 days ago)
Assigned 12/08/2008 (208 days ago)
Resolved 12/09/2008 (207 days ago)
Attachments archive.tar.gz Download
Milestone
Patch No

History
12/09/2008 Michael Slusarz Comment #12
State ⇒ Not A Bug
Reply to this comment
# file archive.tgz
archive.tgz: gzip compressed data, from Unix, last modified: Mon Dec 
  8 11:28:54 2008
And this is correct.  This is a gzip'd file.  How can 'file' know what 
is inside the file without uncompressing it?  'file' simply guess what 
kind of data is in the file.
Not much of a difference. So where is the MIME type sent to 
HORDE/IMP coming from?
The browser/OS.
For a ".tgz", IMP receives "application/x-gtar" and for a ".tar.gz", 
it receives "application/x-gzip"
Technically, there is nothing wrong with application/x-gzip.  Because 
that is exactly what the file is.  On OS's like windows, there can 
only be a single extension.  So the MIME type 'application/x-gzip' is 
correct.  I realize Thunderbird is sending something different, but I 
don't necessarily agree with what they are doing (x-compressed-tar 
does not seem to be used by many people.).

So I think the previous analysis in this ticket remains.
12/08/2008 Chuck Hagenbuch State ⇒ Feedback
 
12/08/2008 marc (at) r4l (dot) com Comment #11
New Attachment: archive.tar.gz Download
Reply to this comment
Should have done the same test on the ".tgz" file in the previous 
post, but here it is:

# file archive.tgz
archive.tgz: gzip compressed data, from Unix, last modified: Mon Dec   
8 11:28:54 2008

Not much of a difference. So where is the MIME type sent to HORDE/IMP 
coming from?

For a ".tgz", IMP receives "application/x-gtar" and for a ".tar.gz", 
it receives "application/x-gzip"

Can someone shed some light on this?
12/08/2008 marc (at) r4l (dot) com Comment #10 Reply to this comment
Silly me, I tested with a ".tgz" instead of a ".tar.gz". So the 
problem is still there, and the "file" command on Linux reports this 
for a ".tar.gz" file:

# file archive.tar.gz
archive.tar.gz: gzip compressed data, from Unix, last modified: Mon 
Dec  8 11:28:54 2008

So it's probably the right behavior. Can someone confirm?

[Hide Quoted Text]
Since I reported this, I re-installed my OS from scratch, and now I 
don't experience the MIME type discrepancy anymore. So it seems 
there was something mis-configured with the MIME types in my 
previous environment.

Thanks for this precision, Michael!
- a .tar.gz attachment sent using Horde/IMP has a MIME type of
"application/x-gzip"
Is this what the browser is sending to Horde/IMP?  We use the MIME
type information provided to us by the user's browser/OS.
12/08/2008 Chuck Hagenbuch State ⇒ Not A Bug
 
12/08/2008 marc (at) r4l (dot) com Comment #9 Reply to this comment
Since I reported this, I re-installed my OS from scratch, and now I 
don't experience the MIME type discrepancy anymore. So it seems there 
was something mis-configured with the MIME types in my previous 
environment.

Thanks for this precision, Michael!
- a .tar.gz attachment sent using Horde/IMP has a MIME type of
"application/x-gzip"
Is this what the browser is sending to Horde/IMP?  We use the MIME 
type information provided to us by the user's browser/OS.
12/07/2008 Michael Slusarz Comment #8 Reply to this comment
- a .tar.gz attachment sent using Horde/IMP has a MIME type of 
"application/x-gzip"
Is this what the browser is sending to Horde/IMP?  We use the MIME 
type information provided to us by the user's browser/OS.
11/17/2008 marc (at) r4l (dot) com Comment #7 Reply to this comment
More details for the problem when trying to view the content listing 
of a tar.gz file within IMP:

- a .tar.gz attachment sent using Horde/IMP has a MIME type of 
"application/x-gzip"
- a .tar.gz attachment sent using Thunderbird has a MIME type of 
"application/x-compressed-tar"

Which probably explain the problem (and is probably caused by a 
limitation in the MIME library, as Chuck already mentioned)
11/16/2008 marc (at) r4l (dot) com Comment #6 Reply to this comment
- the file will be compressed TWICE
I can't reproduce this.
I tested again, and it really needs to be a compressed TAR  FILE, not 
just a compressed FILE.


11/16/2008 marc (at) r4l (dot) com Comment #5 Reply to this comment
No. Individual gzipped files are different from tar files.
OK, but I really meant "tar.gz" files, not just gzipped files.
11/16/2008 Chuck Hagenbuch Comment #4 Reply to this comment
No. Individual gzipped files are different from tar files.
11/16/2008 marc (at) r4l (dot) com Comment #3 Reply to this comment
So, are you saying the problem happens with Horde's MIME library WHEN 
UPLOADING the gzipped attachment? Otherwise, If you're saying it's 
only when OPENING the attachment, then it would not explain why this 
does not happen with an attachment in an email created OUTSIDE of Horde.
11/16/2008 Chuck Hagenbuch State ⇒ Feedback
 
11/16/2008 Chuck Hagenbuch Comment #2 Reply to this comment
- the file will be compressed TWICE
I can't reproduce this.
Also, independantly of the setting above, any uploaded .tgz (or 
.tbz) file cannot be opened in IMP (gives error: "Content type of 
compressed file: Unknown")
This is a limitation of the current MIME lib and can't be fixed until IMP 5.
11/13/2008 marc (at) r4l (dot) com Comment #1
Patch ⇒
Milestone ⇒
Summary ⇒ gzip/bzip2 upload doubly compressed
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Queue ⇒ IMP
Reply to this comment
Reproduce method:

- enable "$conf[compress_pages]" in horde config
- upload a gzip/bzip2 file in IMP compose window
- send that email to yourself
- open the email you just sent
- download the gzip/bzip2 file to local disk
- the file will be compressed TWICE

Also, independantly of the setting above, any uploaded .tgz (or .tbz) 
file cannot be
opened in IMP (gives error: "Content type of compressed file: Unknown")

If I receive an email that contains a .tgz/tbz file (and that email 
has not been created with IMP), the attached compressed tar file 
content can be read within IMP, which leads me to believe there is a 
link with the upload bug above.