diff --git a/plugins/libkolab/lib/kolab_format.php b/plugins/libkolab/lib/kolab_format.php index 11a5c4fe..1c5fd128 100644 --- a/plugins/libkolab/lib/kolab_format.php +++ b/plugins/libkolab/lib/kolab_format.php @@ -531,8 +531,19 @@ abstract class kolab_format continue; $attach = new Attachment; $attach->setLabel((string)$attr['name']); - $attach->setUri('cid:' . $cid, $attr['mimetype']); - $vattach->push($attach); + $attach->setUri('cid:' . $cid, $attr['mimetype'] ?: 'application/octet-stream'); + if ($attach->isValid()) { + $vattach->push($attach); + } + else { + rcube::raise_error(array( + 'code' => 660, + 'type' => 'php', + 'file' => __FILE__, + 'line' => __LINE__, + 'message' => "Invalid attributes for attachment $cid: " . var_export($attr, true), + ), true); + } } foreach ((array) $object['links'] as $link) {