Hi,
I have an email with a single mime part which looks like this (irrelevant headers removed):
=========================================== Content-class: urn:content-classes:message X-MS-Has-Attach: yes MIME-Version: 1.0 Content-Type: application/vnd.ms-excel; name="Bureau CVL 06-10.xls" Content-Transfer-Encoding: base64 Content-Description: Bureau CVL 06-10.xls Content-Disposition: attachment; filename="Bureau CVL 06-10.xls" X-MS-TNEF-Correlator: X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAA EAAAEgAAAAEAAAD+////AAAAAAAAAAD///////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// etc... ===========================================
So basically it's a single mime part email. This usually does not happen with _normal_ MUA's, but MS Exchange seems not to care what the world thinks.
Anyway, I fixed this one with attached patch, but I am not sure about any impact with other emails with or without attachments. I looked at about 50 different emails with and without attachments, from normal users and MS users, and I found no error so far.
Would you people please take a look and see if this is fine?
Robin
--- program/lib/mime.inc (revision 382) +++ program/lib/mime.inc (working copy) @@ -108,7 +108,7 @@ } //echo "s - part: $part rest: $rest array: ".implode(" ", $a)."<br>\n"; if (is_array($a[$part-1])) return $a[$part-1];
else return false;
else return $a;
}else if (($part==0) || (empty($part))){
return $a;
}--- program/steps/mail/func.inc (revision 382) +++ program/steps/mail/func.inc (working copy) @@ -983,6 +983,18 @@ } }
($fname = $structure->ctype_parameters['name']) ||
($fname = $structure->headers['content-description']))
{
$structure->filename = rcube_imap::decode_mime_string($fname);
$a_attachments[] = $structure;
}