Author Topic: Attachments appear corrupted  (Read 15141 times)

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Attachments appear corrupted
« on: May 29, 2012, 04:09:57 AM »
Hi,
I'm testing currently the rc 0.8 beta on nginx and I got issues when I try to preview or download images, doc, docx, etc files. The only ones which appear to work are pdfs, txt and files based on xml like svg.

When I download the attachment with e.g. thunderbird everything is ok, so is it a bug in rc 0.8 beta because it is working with roundcube 0.7.2.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Attachments appear corrupted
« Reply #1 on: May 29, 2012, 06:23:48 AM »
I able to download attachments fine in RoundCube 0.8-rc on an Apache server.

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #2 on: May 29, 2012, 12:49:05 PM »
i can provide a test account if you like.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Attachments appear corrupted
« Reply #3 on: May 30, 2012, 03:33:13 AM »
I don't think that would help very much. Since it works on an full Apache system its obviously a bug thats more platform specific. Out of curiosity are you using Nginx as a passthrough to Apache or are you using PHP-FPM?

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #4 on: May 30, 2012, 06:46:00 AM »
My configuration on the server is.

nginx 1.2.0-1~dotdeb.1
php5-fpm 5.3.13-1~dotdeb.0

Pages are served with php5-fpm and nginx. No passthrough.

EDIT:
It appears that the rc 0.7.2 version is outputting the file as dos\windows ansi and the rc0.8 beta as dos\windows utf-8.

When I convert now the rc 0.8 beta version with notepad++ to utf-8 without bom it works.
tested on an jpg.

So I'm guessing something changed with attachment encoding from 0.7.2 -> 0.8 beta because as I said, version 0.7.2 is
working.
« Last Edit: May 30, 2012, 09:40:34 AM by horfic »

Offline Bouni

  • Newbie
  • *
  • Posts: 1
Re: Attachments appear corrupted
« Reply #5 on: May 31, 2012, 05:04:45 AM »
Hi,

i have the same issue.

My Configuration is:

Apache/2.2.16 (Debian) Server
PHP 5.3.3-7+squeeze9
Roundcube Webmail 0.9-svn [SVN r6144]

If i click on the attached picture i get the following message:
Code: [Select]
The image “https://******/?_task=mail&_action=get&_mbox=INBOX&_uid=9425&_part=2” cannot be displayed because it contains errors."If i right click on the attachment and choose save link as, i can download the image, but it is broken and cannot be displayed.


Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #6 on: June 15, 2012, 12:45:41 AM »
Any news on it? I mean obviously I'm not the only one and it is also not only nginx also apache

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Attachments appear corrupted
« Reply #7 on: June 15, 2012, 03:37:45 AM »
I setup a fresh box running the following:
- Debian GNU/Linux 6.0.5 (squeeze)
- nginx 1.2.1-1~dotdeb.0
- php5-fpm 5.3.13-1~dotdeb.0
- RoundCube 0.8-RC

I tested RoundCube with a .jpg, .pdf, .doc, .docx and they all worked fine, I also tested a very similar setup on CentOS which also worked fine. I'm not sure what else I could change to reproduce the problem.

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #8 on: June 15, 2012, 06:07:31 AM »
well that means that there is still a bug.

This is the response header of roundcube itself.
Quote
Cache-Control   private, no-cache, must-revalidate, post-check=0, pre-check=0
Connection   keep-alive
Content-Type   text/plain; charset=UTF-8
Date   Fri, 15 Jun 2012 10:01:22 GMT
Expires   Fri, 15 Jun 2012 10:01:22 GMT
Last-Modified   Fri, 15 Jun 2012 10:01:22 GMT
Pragma   no-cache
Server   nginx/1.2.1
Transfer-Encoding   chunked
X-Powered-By   PHP/5.3.13-1~dotdeb.0
x-dns-prefetch-control   off


This for example for a png called RankAPic-Logo.png
Quote
Cache-Control:private, no-cache, must-revalidate, post-check=0, pre-check=0
Connection:keep-alive
Content-Disposition:attachment; filename="RankAPic-Logo.png"
Content-Type:application/octet-stream
Date:Fri, 15 Jun 2012 10:03:20 GMT
Expires:Fri, 15 Jun 2012 10:03:20 GMT
Last-Modified:Fri, 15 Jun 2012 10:03:20 GMT
Pragma:no-cache
Server:nginx/1.2.1
Transfer-Encoding:chunked
X-Powered-By:PHP/5.3.13-1~dotdeb.0
x-dns-prefetch-control:off

What happens if you switch roundcube attachment download/preview from utf-8 to utf-8 without bom?

Because as I mentioned it does work after I download the files and convert them.

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Attachments appear corrupted
« Reply #9 on: June 15, 2012, 10:21:44 AM »
The headers are the same as the one on my system, what do you mean by:
What happens if you switch roundcube attachment download/preview from utf-8 to utf-8 without bom?

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #10 on: June 15, 2012, 10:31:30 AM »
Well, as I stated in a previous post

Quote
It appears that the rc 0.7.2 version is outputting the file as dos\windows ansi and the rc0.8 beta as dos\windows utf-8.

When I convert now the downloaded attachment from rc 0.8 beta version with notepad++ to utf-8 without bom, it works.
tested on an jpg.

So I'm guessing something changed with attachment encoding from 0.7.2 -> 0.8 beta because as I said, version 0.7.2 is
working.

BOM = Byte order mark

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Attachments appear corrupted
« Reply #11 on: June 15, 2012, 10:52:18 AM »
I'm still not 100% sure what you mean, the file is downloading as a ANSI if I convert it to UTF-8 without BOM it breaks.

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #12 on: June 15, 2012, 03:15:32 PM »
In RC 0.7.x, the attachments getting downloaded as ansi encoded file.

In RC 0.8.x the attachments getting downloaded as utf-8 encoded file.
This utf-8 encoded file is corrupted and if I'm converting the downloaded file from utf-8 to utf-8 without bom the file works fine.

Now?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Attachments appear corrupted
« Reply #13 on: June 15, 2012, 05:20:24 PM »
Not sure in my RoundCube 0.8-RC install the attachment file was downloading as ANSI. Maybe its a problem tied to the mail server or actual attachment file.

Offline horfic

  • Jr. Member
  • **
  • Posts: 49
Re: Attachments appear corrupted
« Reply #14 on: June 16, 2012, 05:24:01 AM »
I don't think thats a problem with my mailserver or the attachments!

All attachments work under thunderbird, outlook, roundcube 0.7.x, mac mail, etc. works all.

Just not rc 0.8.