Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cant open pdf attachment

Status
Not open for further replies.

razalas

Programmer
Apr 23, 2002
237
US
Am sending e-mail with pdf attachment from Linux RHEL to corporate e-mail server (Kerio Connect 7.1), which is delivered to user desktops who are using Outlook 2003 mail client, but we can't successfully open the pdf attachment from Outlook 2003 mail client. When we attempt to open the pdf, we get the following message from Adobe Reader (v 8.2.5):

"Adobe Reader could not open 'AR-0033GOLDM4522860101.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."

However, same e-mail with attachment copied to external mail (gmail) does allow attachment to be opened successfully from within gmail. I am fantasizing that this is simply a case of needing to "tweak" the headers to get Outlook to cooperate. Anybody got any suggestions?

Email headers, as fed directly to sendmail, follow:
Code:
From: myname@mydomain.com
Subject: Invoice 12345-434034 Reprint
To: myname@mydomain.com
Cc: myname@gmail.com
MIME-Version: 1.0 (AR-0033-20110104-17332557)
Content-Type: Multipart/Mixed; boundary=Message-Boundary-UT-003-0000028554


--Message-Boundary-UT-003-0000028554
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Content-Description: message body;filename="Read Me First"
Content-Id: <AR-0033-20110104-17332557-0000028554-12@devlp1>

email message body goes here


--Message-Boundary-UT-003-0000028554
Content-Type: Application/pdf
Content-Transfer-Encoding: Base64
Content-Description: attachment;filename=AR-0033NATIO4340340101.pdf
Content-Id: <AR-0033-20110104-17332557-0000028554-18@devlp1>
Content-Disposition: attachment;filename=AR-0033NATIO4340340101.pdf

begin-base64 664 AR-0033NATIO4340340101.pdf
JVBERi0xLjYNJeLjz9MNMSAwIG9iag08PC9MZW5ndGggMjYwL0ZpbHRlclsv

... data omitted ...

MEM2NEVBODkxODlGNTk4OUQ2Mjg+IF0NPj4Nc3RhcnR4cmVmDTEwODk2MTUN
JSVFT0YN
====
--Message-Boundary-UT-003-0000028554--

Code what you mean,
and mean what you code!
But by all means post your code!

Razalas
 
first thing i would do is update reader on the machines receiving the pdf.

if the pdf is sent to gmail, opens/displays fine and is then fwd to corporate email, what occurs? still unable to display?

what is being used to generate the pdf file?

 
I can open the pdf just fine if I deliver it to my desktop via ftp. So, I believe the issue is not the version of Adobe Reader, but rather something that's happening in the transport or handling of the attachment when delivered via the mail system.

If we forward the e-mail from the gmail account (where we can open the pdf) back in-house, we still cannot open it.

I am thinking the next tree I need to bark up is Kerio Connect, although I searched their knowledgebase and didn't find what I was hoping for.

Code what you mean,
and mean what you code!
But by all means post your code!

Razalas
 
Figured it out. Removed the "begin" header (see highlighted in example below) created by the uuencoding of the pdf attachment data. Now it works ok.

Code:
From: myname@mydomain.com
Subject: Invoice 12345-434034 Reprint
To: myname@mydomain.com
Cc: myname@gmail.com
MIME-Version: 1.0 (AR-0033-20110104-17332557)
Content-Type: Multipart/Mixed; boundary=Message-Boundary-UT-003-0000028554


--Message-Boundary-UT-003-0000028554
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Content-Description: message body;filename="Read Me First"
Content-Id: <AR-0033-20110104-17332557-0000028554-12@devlp1>

email message body goes here


--Message-Boundary-UT-003-0000028554
Content-Type: Application/pdf
Content-Transfer-Encoding: Base64
Content-Description: attachment;filename=AR-0033NATIO4340340101.pdf
Content-Id: <AR-0033-20110104-17332557-0000028554-18@devlp1>
Content-Disposition: attachment;filename=AR-0033NATIO4340340101.pdf

[red][b]begin-base64 664 AR-0033NATIO4340340101.pdf[/b][/red]
JVBERi0xLjYNJeLjz9MNMSAwIG9iag08PC9MZW5ndGggMjYwL0ZpbHRlclsv

... data omitted ...

MEM2NEVBODkxODlGNTk4OUQ2Mjg+IF0NPj4Nc3RhcnR4cmVmDTEwODk2MTUN
JSVFT0YN
====
--Message-Boundary-UT-003-0000028554--

Code what you mean,
and mean what you code!
But by all means post your code!

Razalas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top