Author Topic: Inbound message missing attachments  (Read 8791 times)

Offline bamnptow

  • Newbie
  • *
  • Posts: 9
Inbound message missing attachments
« on: August 17, 2006, 09:31:00 PM »
I am using the beta2 release and am having trouble with some inbound messages with attachments. Here are the particulars:

- The inbox window shows that there are attachments.
- If I look at the message source, I see the details of the attachments -- it is a multipart mime message, and the attachments are the additional parts.
- When I open the message in Outlook Express, TYhunderbird, and IlohaMail, I can see and open the attachments.
- When I open the message in Roundcube, I cannot see the attachments.
- The examples I have so far are sent using the Blat smtp mailer, but I don't have enough examples to know if it is really only Blat causing the issue.
- Interestingly, if I use Roundcube to forward the message to myself, the attachments are visible and can be opened from within Roundcube.

Any ideas?

Here is part of the message source from the most recent example:

Date: Thu, 17 Aug 2006 21:22:30 -0400
From: my@email.address
To: my@email.address
X-Mailer: Blat v2.5.0 w/GSS encryption, a Win32 SMTP/NNTP mailer http://www.blat.net
Message-ID: <01c6c264$Blat.v2.5.0$c5fbfac2$1f2c@10.0.0.11>
Subject: Daily Log Files
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="=_BlatBoundary-fOdaaeCDKOQlMtRzEnNFo"

This is a multi-part message in MIME format.

--=_BlatBoundary-fOdaaeCDKOQlMtRzEnNFo
Content-description: Mail message body
Content-Transfer-Encoding: 7BIT
Content-Type: text/plain; charset=ISO-8859-1

Today's log files are attached.

--=_BlatBoundary-fOdaaeCDKOQlMtRzEnNFo
Content-Type: application/octet-stream;
 name="mercore.log"
Content-Disposition: ATTACHMENT;
 filename="mercore.log"
Content-Transfer-Encoding: BASE64

TyAyMDA2MDcwOCAxNzI0IE1HMDAwMEMyIHN0ZXZlQHJhaWEudXMgICAgICAgICAgICAgICAg
ICBqb2huQGF0aGFzLmNvbSAgICAgICAgICAgICAgICAgODU5DQpJIDIwMDYwNzA4IDE3NDMg

etc.

Offline bamnptow

  • Newbie
  • *
  • Posts: 9
Re: Inbound message missing attachments
« Reply #1 on: August 18, 2006, 04:11:13 PM »
I found a message that is not generated by Blat that works the same way.

The Mercury/32 mailing list, which is generated by Listserv, sends its daily digest with the day's posts attached. These attachments also do not show up in the beta2 of Roundcube.

If I look at the message source in Roundcube, I can see them, but they do not appear if I just try to open the message from the Inbox normally.

The attachments work fine in Thunderbird, Outlook Express, and Ilohamail.

Given this, it seems unlikely that Blat is the cause of my problem.

Offline infoeon

  • Newbie
  • *
  • Posts: 3
Re: Inbound message missing attachments
« Reply #2 on: September 07, 2006, 09:32:54 AM »
I have the same issue but with emails generated from Juno. Here is some sample data:

Return-Path:
Received: from m9.nyc.untd.com ([127.0.0.1])
  by server.XXXX.com
  with XXXX ; Wed, 30 Aug 2006 19:29:56 -0500
Received: from 64.136.22.72 ([64.136.22.72] helo=m9.nyc.untd.com) by
  spam.XXXX.com; 30 Aug 2006 19:29:54 -0500
Received: from m9.nyc.untd.com (localhost [127.0.0.1])
  by m9.nyc.untd.com with SMTP id XXXX
  for (sender );
  Wed, 30 Aug 2006 17:31:07 -0700 (PDT)
X-UNTD-OriginStamp: XXXX==
Received: (from XXXX@juno.com)
 by m9.nyc.untd.com (jqueuemail) id XXXXXXXX; Wed, 30 Aug 2006 17:30:22 PDT
To: XXXX@XXXX.com
Cc: XXXX@XXXX.com
Date: Wed, 30 Aug 2006 19:04:27 -0500
Subject: Fw: Treadmill dance
Message-ID: <20060830.190428.3516.4.XXXX@juno.com>
X-Mailer: Juno 5.0.33
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=--__JNP_000_2426.1280.6e14
From: XXXX
X-ContentStamp: 1:1:493504430
X-UNTD-Peer-Info: 127.0.0.1|localhost|m9.nyc.untd.com|XXXX@juno.com
X-Assp-Received-SPF: pass (spam.XXXX.com: domain of XXXX@juno.com
  designates 64.136.22.72 as permitted sender) client-ip=64.136.22.72;
  envelope-from= XXXX@juno.com; helo=m9.nyc.untd.com;

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

----__JNP_000_2426.1280.6e14
Content-Type: multipart/alternative; boundary=--__JNP_000_4817.464d.5164

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

----__JNP_000_4817.464d.5164
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


 This is a fun workout!
----__JNP_000_4817.464d.5164
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: quoted-printable






 

style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> FONT>face=3DArial color=3Dblue size=3D2>style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"> This is a =
fun=20
workout!
style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> FONT>


style=3D"FONT-SIZE: 12pt"> 


 


----__JNP_000_4817.464d.5164--

----__JNP_000_2426.1280.6e14
Content-Type: video/x-ms-wmv; name="some file.wmv"
Content-Transfer-Encoding: base64



----__JNP_000_2426.1280.6e14--

Offline ipfreaks

  • Jr. Member
  • **
  • Posts: 13
Re: Inbound message missing attachments
« Reply #3 on: September 11, 2006, 03:59:24 AM »
i have the problem, too.
roundcube shows the mail i've sent with an attachment without the attachment-icon. the mail has the same size as the attachment. i could not verify which attachment sizes are the the problem... sometimes little attachments has the problem, sometimes only big attachments...

anyone an idea?
thanks!!
ipfreaks

version: 0.1-beta2 and the same issue with SVN 327 :(

Offline zman818

  • Newbie
  • *
  • Posts: 2
Re: Inbound message missing attachments
« Reply #4 on: September 13, 2006, 02:36:02 PM »
Based on other posts here, it would appear the Beta 2 is having some problems handling multipart attachments properly. Hopefully the developers will identify and address the issue.

I had severe problems with Beta 2 mangling zip and other binary attachments that were properly opened by RC Beta 1 and SquirrelMail.

Offline Guillermolococo

  • Newbie
  • *
  • Posts: 6
Re: Inbound message missing attachments
« Reply #5 on: September 15, 2006, 04:46:10 AM »
Hello,

I have the same problem. Our clients (about 150 clients) have problems opening PDF files. I tried to fix but I cant. I dont know where is the problem.

" Houston, we have a problem ! "

If some one have any idea, please, post it.
Thanks soo much !

Offline desertadmin

  • Jr. Member
  • **
  • Posts: 36
Re: Inbound message missing attachments
« Reply #6 on: September 15, 2006, 07:57:12 PM »
This was noticed by my 800+ clients Is there any alternative. I am really trying to convince everyone that roundcube is the way. And I will be toughing it alot more but is there any one out there with an answer to this issue?

Just curious. Thanks for everyone's help and comments on my other posts of odd questiosn that I have had. This is a very active community.

-Cheers
..::DesertAdmin::..

Offline syc

  • Jr. Member
  • **
  • Posts: 14
Re: Inbound message missing attachments
« Reply #7 on: November 20, 2006, 11:47:11 AM »
I've also run into this problem and I started to debug the application.

I looked into the mimeDecode calls that were being recursively made and it seems that part of the structure is not recognized properly.

This happens from emails from Outlook Express and Outlook 2003 from what I've been able to test so far.

I tested sending attachments from GMail and Hotmail to Roundcube and it had no issues with the files.

Looking at the source of the email coming from Outlook apps, you can see the major differences in the structure of the email.

I'm also wondering if PEAR's mimeDecode stuff is partly to blame, but I'll keep you guys updated.

I'm working on a fix.

UPDATE:

Latest SVN, when viewing emails with attachments from Outlook, the only thing you will see is the body of them message. After this, the cache is corrupted and you lose all your message headers when viewing your Inbox. Very interesting.

Offline syc

  • Jr. Member
  • **
  • Posts: 14
Re: Inbound message missing attachments
« Reply #8 on: November 20, 2006, 03:12:44 PM »
Here is the fix. It is unrelated to RoundCube. Blame PEAR mimeDecode crap.

Open up mimeDecode.php in 'program/lib/Mail'.

Find line: 503 or look at the _boundrySplit function.

OLD LINE:
Code: [Select]
for ($i = 1; $i < count($tmp) - 1; $i++) {
NEW LINE:
Code: [Select]
for ($i = 1; $i < count($tmp) /*- 1*/; $i++) {

Offline tomvos

  • Newbie
  • *
  • Posts: 2
Re: Inbound message missing attachments
« Reply #9 on: November 21, 2006, 03:55:13 PM »
Hello,

I have the same issue with missing attachments and missing text body. I applied the bugfix proposed by syc, but unfortunatly it did not help. Do you know of any other possible solutions?

I'm using MAMP (PHP 4.4.4, mysql 5.0.19), but the same happens with php5.

Thanks.

P.S.
Roundcube seems very promising to me.

Offline fconil

  • Newbie
  • *
  • Posts: 3
Re: Inbound message missing attachments
« Reply #10 on: November 27, 2006, 11:26:21 AM »
After a lot of searching, I found that thunderbird 1.5 encode the attachment header differently.

Former versions, outlook, webmails and so long use name="overly long file name" while thunderbird 1.5 splits it on several lines in this way :
name*0*=Encoding''Hexadecimal values of each char in the filename
name*1*=Hexadecimal values continuing

Needless to say the attachment, tho recognized in the messages list and viewable in the source of the message is nowhere to be found when you actually open the said message.

Is there a way to know where the name part is decoded/used by roundcube ?
I could make a quick fix to it, but I'm completely at loss as to where the decoding actually takes part :/

Offline syc

  • Jr. Member
  • **
  • Posts: 14
Re: Inbound message missing attachments
« Reply #11 on: November 27, 2006, 11:51:26 AM »
It takes part in get.inc in program/steps/mail and also in mimeDecode in the lib dir.

Offline fconil

  • Newbie
  • *
  • Posts: 3
Re: Inbound message missing attachments
« Reply #12 on: November 30, 2006, 08:15:05 AM »
So I managed to get a dirty fix for it if anyone is interested.

Basically, the way mimedecode works, it creates an array ctype_parameters whose keys are 'name', 'filename' and so long, but it gets them from the mail headers.

With thunderbird modifying the headers to name*, name*0 and name*0* (depending on whether there are special chars in the filename), you have to :
- test if ctype_parameters['name*'] exists (same for name*0 and name*0*)
- recreate the filename by concatenating the various strings
- bypass the call to mime_decode and use urldecode instead (for some weird reasons, a filename containing special chars will be encoding using url entities like %XX instead of what every other mail client does, ie. Encoding only the special chars)

All of this in the func.inc and get.inc file, the later being used to download non image, non pdf attachments.
I'll post my messy code if needed.

Offline desertadmin

  • Jr. Member
  • **
  • Posts: 36
Re: Inbound message missing attachments
« Reply #13 on: December 13, 2006, 01:57:42 PM »
Please post your code I would love to see this resolved or at least a work around.. thanks!

-Sincerely,
DesertAdmin

Offline NoOne

  • Newbie
  • *
  • Posts: 4
Re: Inbound message missing attachments
« Reply #14 on: December 14, 2006, 03:24:23 PM »
i still have the same problems....
tested beta2, beta1, svn-391
the mails are also not tagged with the attachment icon...

doesn't work:
Code: [Select]
--Apple-Mail-5-977473388
Content-Transfer-Encoding: base64
Content-Type: image/bmp;
x-unix-mode=0666;
name=chemie.bmp
Content-Disposition: inline;
filename=chemie.bmp

works:
Code: [Select]
--=_876bd9b3d289e7ce5ca8f5ae974a7b49--
--=_9ed44e9f31445fd74a40b2986f53ae67
Content-Transfer-Encoding: base64
Content-Type: image/bmp; name="test.bmp"
Content-Disposition: attachment; filename="test.bmp"

also works:
Code: [Select]
--Apple-Mail-27-643414055
Content-Transfer-Encoding: base64
Content-Type: application/applefile;
name=villa3.psd
Content-Disposition: inline;
filename=villa3.psd

greez NoOne