Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-26-2008, 06:22 AM
Intermediate Member
 
Posts: 16
Default PDF file attachments gets corrupted

Hi.

I have a problem sending PDF's to some of my customers via Zimbra webinterface (only tried using the web GUI). I can't reproduce the same problem sending the same PDF file from ie. Gmail.

I've saved the 2 emails (the on with the problem and the one without) to eml files to look inside and I can see PDF files are attached differently:

PDF sent from Zimbra web GUI (this files gets corrupted on the customer end):

Code:
snip

------=_Part_1982_12082751.1214481564556
Content-Type: application/pdf; name=100075.pdf
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=100075.pdf

%PDF-1.4
1 0 obj
<<
/Creator (Oracle10gR2 AS Reports Services)
/CreationDate (D:20080626115829)
/ModDate (D:20080626115829)
/Producer (Oracle PDF driver)
/Title (test@domain.com)
/Author (Oracle Reports)
>>
endobj
5 0 obj
<</Length 6 0 R
/Filter [/ASCII85Decode /FlateDecode]
>>
stream
Gb!#\9lJcU&A9%PIi.8-+==e6gb8M'>,3H6''YLbPs[/mRKbC5VKRLjrV)jcIYa0.:bmDH%*R5m
c/\6YbaY/O3^7+<A&&h-.a*5m^^<HdT"i&Fr]38j!bJ_l,V]/$4S4nnJ8j<?Tn(JHi9KhOL\NrY
+>th!p?VP-9m(n3<8^sg!=QuIMU0VODAbu<o[WEnB,@2Ts8DCjW;]%LZ4Te+7Y"sf%pD(#c8n(#

snip
PDF sent from gmail (the one that works):

Code:
snip

------=_Part_1766_3760052.1214481631884
Content-Type: application/pdf; name=100075.pdf
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fhxazrk00
Content-Disposition: attachment; filename=100075.pdf

JVBERi0xLjQNCjEgMCBvYmoNCjw8DQovQ3JlYXRvciAoT3JhY2xlMTBnUjIgQVMgUmVwb3J0cyBT
ZXJ2aWNlcykNCi9DcmVhdGlvbkRhdGUgKEQ6MjAwODA2MjYxMTU4MjkpDQovTW9kRGF0ZSAoRDoy
MDA4MDYyNjExNTgyOSkNCi9Qcm9kdWNlciAoT3JhY2xlIFBERiBkcml2ZXIpDQovVGl0bGUgKGxt
bEBjYXJnb21hc3Rlci5kaykNCi9BdXRob3IgKE9yYWNsZSBSZXBvcnRzKQ0KPj4NCmVuZG9iag0K

snip
I had the customer send back the corrupted PDF and when I run a diif on the corrupted PDF and they look almost the same a side from each line seems to have a dot prepended... here is a snip:

Code:
 diff 100075.pdf 100075_corrupted.pdf
125,129c125,129
< .WS1MZ&UjE!*Ql5.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
< .&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
< .&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
< .&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
< .&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!j#fik
---
> ..WS1MZ&UjE!*Ql5.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
> ..&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
> ..&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
> ..&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!
> ..&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!.&)S!j#fik
139c139
< .)%4tIh@a!,DJ[ESJgCEiQ\ou'U[^NCRF7H>uhbI`RjfZrX'tO!!P@W4oYKbm.`U!%u@gCKtL.M
---
> ..)%4tIh@a!,DJ[ESJgCEiQ\ou'U[^NCRF7H>uhbI`RjfZrX'tO!!P@W4oYKbm.`U!%u@gCKtL.M

snip

The error seems to be a combination error where Zimbra is part of the equation... some customers doesn't have problemes viewing the PDF's and others (always the same) does. If I send the same PDF's from something else like Gmail all customers can view the PDF's. But I'm not convinced that Zimbra is making the error but I would like to know if there is anything I can change in Zimbra so all my customers can receive the PDF's without any hassel?

Last edited by wiscalico; 08-14-2008 at 02:45 AM..
Reply With Quote
  #2 (permalink)  
Old 06-26-2008, 07:30 AM
nrc nrc is offline
Special Member
 
Posts: 156
Default

The two dots are part of the SMTP protocol - see section 4.5.2 of RFC2821.

http://www.ietf.org/rfc/rfc2821.txt

Quote:
- Before sending a line of mail text, the SMTP client checks the first character of the line. If it is a period, one additional period is inserted at the beginning of the line.

- When a line of mail text is received by the SMTP server, it checks the line. If the line is composed of a single period, it is treated as the end of mail indicator. If the first character is a period and there are other characters on the line, the first character is deleted.
So something isn't following the rules. This problem may be caused by one of the SMTP hops between you and your recipient. If you send the attachment to yourself at Gmail is it corrupted?

What version of Zimbra are you running?
Reply With Quote
  #3 (permalink)  
Old 06-26-2008, 07:49 AM
Intermediate Member
 
Posts: 16
Default

If I send the PDF to my Gmail account everything works just fine.

This happens with both Zimbra version 5.0.5 and 5.0.6.
Reply With Quote
  #4 (permalink)  
Old 06-26-2008, 08:49 AM
nrc nrc is offline
Special Member
 
Posts: 156
Default

So it seems likely that everything is ok with Zimbra. It sounds like either Gmail is taking a different path to your customer and avoiding a broken SMTP server or their MTA recognizes the broken SMTP service and handles it.

If your recipient can provide you with a full copy of received headers from the Gmail message and the Zimbra message that may show the difference in paths and identify potentially broken relays.
Reply With Quote
  #5 (permalink)  
Old 06-26-2008, 10:47 PM
Intermediate Member
 
Posts: 16
Default

I can't really change how the relays work even though they are the ones with the fault.

Can I do anyting within Zimbra to change who it attaches PDF files without assigning a person zip every PDF file and one in the other end to unzip em again
Reply With Quote
  #6 (permalink)  
Old 06-26-2008, 11:22 PM
Outstanding Member
 
Posts: 708
Default

For a correct diagnosis that unfortunately didn't lead to a more general fix, see comment 22 at Bug 15612 &ndash; zimbra corrupts pdf generated by ms office with acrobat distiller

ZWC blindly trusts the client browser to encode attachments in a reasonable way (MIME type tagging, choice of ascii/base64/qp encoding). GMail and other webmails do more second-guessing of untrustworthy user input and re-encode as appropriate.

I've seen a lot of cases where people couldn't attach (for example) Word or Excel files because a bad MIME response from some completely unrelated web server was trusted by Firefox, causing subsequent uploads of said file type to *any* web application to be encoded incorrectly.

The "solution" to bug 15612 was to hard-code a specific fix to a specific instance of the general problem. I've had a couple support cases open on permutations of the issue but haven't gotten much traction.
Reply With Quote
  #7 (permalink)  
Old 06-26-2008, 11:24 PM
Outstanding Member
 
Posts: 708
Default

Oh, as a workaround: IE and Safari are less likely to get uploaded file types/encodings wrong than Firefox.
Reply With Quote
  #8 (permalink)  
Old 06-27-2008, 12:42 AM
Intermediate Member
 
Posts: 16
Default

Quote:
Originally Posted by Rich Graves View Post
IE and Safari are less likely to get uploaded file types/encodings wrong than Firefox.
I tried using IE 7.0.5730.11 on a Windows XP platform PDF's on the recieving side are still bugged
Reply With Quote
  #9 (permalink)  
Old 07-17-2008, 03:25 AM
Junior Member
 
Posts: 5
Default

We have the same problem, after upgrade from 5.0.2 to 5.0.7 sometimes, attachment in PDF (generated with distiller) are corrupted but only with firefox.

We are uning zimbra since 4.5 and we never had this kind of problem (30 users)
Reply With Quote
  #10 (permalink)  
Old 08-27-2008, 11:27 PM
Special Member
 
Posts: 118
Default

Has there been any more thought on this? As today I am getting the behavior on a couple of my users.

With one it only seems to be effecting some pdf's generated by our ERP, however its the same pdf being sent to about a dozen of my other users and for them it works fine.

The other user complaining about this it seems to be randomly effecting pdf's no matter the source, ie one of my other users sent him 3 email with 3-4 pdfs in each and about half work and half don't.

With both users if they fwd the emails to themselves the attachments work fine.
__________________
Vote to Make CentOS Official;
http://bugzilla.zimbra.com/show_bug.cgi?id=23487
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.